Jelajahi Sumber

Ajout du démarrage et redémarrage avec la barre Espace.

François Drouhard 9 tahun lalu
induk
melakukan
be6f7401f9
3 mengubah file dengan 13 tambahan dan 8 penghapusan
  1. 4 4
      Chronometre.cpp
  2. 8 3
      MaFenetre.cpp
  3. 1 1
      chronoCheckMate.pro.user

+ 4 - 4
Chronometre.cpp

@@ -39,10 +39,10 @@ Chronometre::Chronometre (const QString & nom , QWidget * parent = 0) : QGroupBo
 	ecranMinute = new QLCDNumber (2, this);
 	ecranSeconde = new QLCDNumber (2, this);
 	ecranCentieme = new QLCDNumber (2 , this);
-	ecranHeure->setSegmentStyle (QLCDNumber::Flat);
-	ecranMinute->setSegmentStyle (QLCDNumber::Flat);
-	ecranSeconde->setSegmentStyle (QLCDNumber::Flat);
-	ecranCentieme->setSegmentStyle (QLCDNumber::Flat);	
+    ecranHeure->setSegmentStyle (QLCDNumber::Flat);
+    ecranMinute->setSegmentStyle (QLCDNumber::Flat);
+    ecranSeconde->setSegmentStyle (QLCDNumber::Flat);
+    ecranCentieme->setSegmentStyle (QLCDNumber::Flat);
 	
 	ecranLayout = new QHBoxLayout;
 	ecranLayout->addWidget(ecranHeure);

+ 8 - 3
MaFenetre.cpp

@@ -126,9 +126,14 @@ void MaFenetre::init () {
 
 void MaFenetre::keyReleaseEvent (QKeyEvent * evenement) {
 	if (evenement->key() == Qt::Key_Space) {
+        if (marche == true) {
             switcher();
-	}
-        if (evenement->key() == Qt::Key_Return) {
-            arreter();
         }
+        if (marche == false) {
+            demarrer();
+        }
+	}
+    if (evenement->key() == Qt::Key_Return) {
+        arreter();
+    }
 }

+ 1 - 1
chronoCheckMate.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.1, 2015-07-18T14:43:48. -->
+<!-- Written by Qt Creator 2.4.1, 2015-07-19T11:28:52. -->
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>