12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include <QApplication>
- #include "mainwindow.h"
- #include "bird.h"
- #include <cstdlib>
- #include <time.h>
- #include <QTimer>
- #include <QObject>
- #include <QDebug>
-
- void FilterBirds(Bird birds[], int N) ;
-
- #include <QTime>
- #include <QtMultimedia/QSound>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- void birth(MainWindow &w, const Bird &mom, const Bird &dad, Bird &child)
- {
- QSound::play( ":bird.wav" );
-
-
- child.setEyebrow(mom.getEyebrow());
- child.setFaceColor(dad.getFaceColor());
-
-
-
-
-
-
-
-
-
-
- w.addBird(100, 210, child);
- w.show();
- }
-
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- MainWindow w;
-
- Bird avelardo, juana, piolin ;
-
-
- w.addBird(10,10,juana);
- w.addBird(210,10,avelardo);
-
-
- QTimer aTimer;
- aTimer.setInterval(1000);
- aTimer.setSingleShot(true);
- aTimer.start();
- QObject::connect(&aTimer,&QTimer::timeout, [&](){ birth(w, juana, avelardo, piolin);});
-
-
- w.show();
- return a.exec();
- }
|