1 #include "testThread.h"
6 TestThread::TestThread(QObject *parent):QThread(parent){
12 qsrand(QDateTime::currentDateTime().toTime_t());
15 TestThread::~TestThread(){
18 void TestThread::run(){
22 qsrand(QDateTime::currentDateTime().toTime_t());
23 sequenza.append(qrand()%9);
27 emit disableInterface();
28 while(i<sequenza.size())
30 emit generate(sequenza.at(i));
31 qDebug()<<sequenza.at(i);
32 msleep(500 - (_score*2));
33 emit generate(sequenza.at(i));
34 msleep(500 - (_score*2));
38 emit enableInterface();
39 attendiInputUtente.wait(&mutex);
48 void TestThread::updateCaption(int inputUser){
52 if(sequenza.at(index)==inputUser)
57 if(index==sequenza.size()){
59 attendiInputUtente.wakeAll();
68 attendiInputUtente.wakeAll();
73 void TestThread::genera()
76 attendiInputUtente.wakeAll();