From d0fcc08805061548b05426b241b67a9b98e8cc46 Mon Sep 17 00:00:00 2001 From: Emmanuel Granatello Date: Fri, 26 Feb 2010 17:31:57 +0100 Subject: [PATCH] Exit applicazione Quando si perde, l'applicazione effettua il quit. TODO: aggiungere i semafori invece della variabile attendiInputUtente. --- mainwindow.cpp | 6 ++--- testThread.cpp | 69 ++++++++++++++++++++++++++------------------------------ 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 62027d7..42ed804 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -50,10 +50,10 @@ MainWindow::MainWindow(QWidget *parent) : void MainWindow::sbagliato(int score){ QString sscore("Score:"); sscore.append(QString::number(score)); - - QMessageBox::warning(this, tr("Sbagliato"),sscore,QMessageBox::Escape); - tread.genera(); + tread.genera(); + //quick_exit(0); + } void MainWindow::disableAll(){ ui->pushButton->setEnabled(false); diff --git a/testThread.cpp b/testThread.cpp index 7c6ba3c..e8d0477 100644 --- a/testThread.cpp +++ b/testThread.cpp @@ -6,9 +6,8 @@ TestThread::TestThread(QObject *parent):QThread(parent){ colore=0; attendiInputUtente=false; - - _score=0; index=0; + _score=0; qsrand(QDateTime::currentDateTime().toTime_t()); @@ -16,53 +15,48 @@ TestThread::TestThread(QObject *parent):QThread(parent){ TestThread::~TestThread(){ } -void TestThread::run() -{ +void TestThread::run(){ while(true){ - //msleep(200); - qsrand(QDateTime::currentDateTime().toTime_t()); - sequenza.append(qrand()%9); - int i=0; - qDebug()<<"Init Emission"; - emit disableInterface(); - while(i