X-Git-Url: http://git.maemo.org/git/?p=qmemory;a=blobdiff_plain;f=mainwindow.cpp;h=2c29cfc6a699ca424ddd544cd34ccaf97d1be221;hp=42ed804747a3bc4a54ba355b26f290dbb26b6d9e;hb=4140673498bea4854f187957133f887a45ddd253;hpb=d0fcc08805061548b05426b241b67a9b98e8cc46 diff --git a/mainwindow.cpp b/mainwindow.cpp index 42ed804..2c29cfc 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -9,8 +9,15 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); + statusLed = new QLed(ui->verticalLayoutWidget); + statusLed->setLayout(ui->horizontalLayout_4); + statusLed->setOnColor(QLed::Red); + statusLed->setOffColor(QLed::Green); + statusLed->setGeometry(QRect(0,0,100,100)); + setCentralWidget(ui->verticalLayoutWidget); connect(&tread,SIGNAL(generate(int)),this,SLOT(cliccaBottone(int))); - connect(&tread,SIGNAL(score(int)),this,SLOT(sbagliato(int))); + connect(&tread,SIGNAL(score(int)),ui->lcdNumber,SLOT(display(int))); + connect(&tread,SIGNAL(exit(int)),this,SLOT(sbagliato(int))); connect(&tread,SIGNAL(disableInterface()),this,SLOT(disableAll())); connect(&tread,SIGNAL(enableInterface()),this,SLOT(enableAll())); connect(this,SIGNAL(cliccatoIlBottone(int)),&tread,SLOT(updateCaption(int))); @@ -26,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent) : tread.start(); - setStyleSheet("QPushButton {" + setStyleSheet("CrazyButton {" "color: white;" "background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88d, stop: 0.1 #99e, stop: 0.49 #77c, stop: 0.5 #66b, stop: 1 #77c);" "border-width: 1px;" @@ -37,10 +44,10 @@ MainWindow::MainWindow(QWidget *parent) : "font-size: 50px;" "padding-left: 5px;" "padding-right: 5px;" - "min-width: 150px;" - "max-width: 150px;" - "min-height: 113px;" - "max-height: 113px;" + "min-width: 15px;" + "max-width: 300px;" + "min-height: 11px;" + "max-height: 300px;" "}" "QPushButton:pressed {" "padding-top: 15px;" @@ -48,11 +55,11 @@ MainWindow::MainWindow(QWidget *parent) : //showMaximized(); } void MainWindow::sbagliato(int score){ - QString sscore("Score:"); + QString sscore("Score "); sscore.append(QString::number(score)); - QMessageBox::warning(this, tr("Sbagliato"),sscore,QMessageBox::Escape); - tread.genera(); - //quick_exit(0); + QMessageBox::warning(this, tr("End Game"),sscore,QMessageBox::Escape); + //tread.genera(); + exit(0); } void MainWindow::disableAll(){ @@ -65,6 +72,7 @@ void MainWindow::disableAll(){ ui->pushButton_7->setEnabled(false); ui->pushButton_8->setEnabled(false); ui->pushButton_9->setEnabled(false); + statusLed->setValue(true); } void MainWindow::enableAll(){ @@ -77,6 +85,7 @@ void MainWindow::enableAll(){ ui->pushButton_7->setEnabled(true); ui->pushButton_8->setEnabled(true); ui->pushButton_9->setEnabled(true); + statusLed->setValue(false); }