I have no idea how to use Qt's wonky, over-complicated (for no reason) event system.
I want to do this every step:
void testfunc() { if (test2!=2) test1+=1;
if (test1>=600) test2=1;
if (test2==1) { sound1.play(); sound1.setLoops(-1); test1=0; test2=2; } }
This is my entire cpp (HTML application):
#include <QApplication> #include "html5applicationviewer.h" #include <QSound>
int test1; int test2; QSound sound1("assets/assets/game.wav");
void testfunc() { if (test2!=2) test1+=1;
if (test1>=600) test2=1;
if (test2==1) { sound1.play(); sound1.setLoops(-1); test1=0; test2=2; } }
int main(int argc, char *argv[]) { QApplication app(argc, argv);
Html5ApplicationViewer viewer; viewer.setOrientation(Html5ApplicationViewer::ScreenOrientationAuto); viewer.showExpanded(); viewer.loadFile(QLatin1String("assets/index.html")); QSound::play("assets/assets/splash.wav"); test1=0; test2=0;
return app.exec(); }
I've googled all over. nowhere seems to be giving me a reasonable fix that makes any sense to me. I hate this QTimer and QObject crap have no idea how to use Timers they're so complicated for no reason.
Please help. Boobs.
|