浏览代码

Ajout d'un message de fin et la possibilité de cliquer sur les images et pas seulement sur les boutons.

Rémi Synave 10 月之前
父节点
当前提交
806f01ddc2
共有 3 个文件被更改,包括 13 次插入0 次删除
  1. 4 0
      WorkArea/WorkArea.cpp
  2. 3 0
      WorkArea/WorkArea.hpp
  3. 6 0
      csl/Experiment.cpp

+ 4 - 0
WorkArea/WorkArea.cpp

@@ -31,6 +31,8 @@
 #include <QDebug>
 #include <QStringList>
 
+#include <iostream>
+
 #include "WorkArea.hpp"
 
 WorkArea::WorkArea (int screenSizeX, int screenSizeY, QWidget * parent):
@@ -339,4 +341,6 @@ void
 WorkArea::mouseReleaseEvent (QMouseEvent * event)
 {
   indexPointClicked = -1;
+
+  emit click();
 }

+ 3 - 0
WorkArea/WorkArea.hpp

@@ -90,6 +90,9 @@ public:
   void addSL(const StrengthLine *sl);
   void addRandomSL();
 
+signals:
+  void click();
+
 };
 
 #endif

+ 6 - 0
csl/Experiment.cpp

@@ -60,6 +60,7 @@ Experiment::Experiment ():QMainWindow()
   
   waLeft = new WorkArea (((screenWidth-spaceInBetween)/2), screenHeight, central);
   waLeft->setContentsMargins(0, 0, 0, 0);
+  connect(waLeft, SIGNAL(click()), this, SLOT(leftImage()));
   layoutH1->addWidget(waLeft);
 
   QWidget *w1SpaceInBetween = new QWidget(central);
@@ -69,6 +70,7 @@ Experiment::Experiment ():QMainWindow()
   
   waRight = new WorkArea (((screenWidth-spaceInBetween)/2), screenHeight, central);
   waRight->setContentsMargins(0, 0, 0, 0);
+  connect(waRight, SIGNAL(click()), this, SLOT(rightImage()));
   layoutH1->addWidget(waRight);
 
   // second line of interface
@@ -265,7 +267,11 @@ Experiment::openNext (){
       QFile fout((*resultPath)+"/"+(*suffix)+QString::fromStdString (".json"));
       fout.open(QIODevice::WriteOnly);
       fout.write(ba);
+
       
+      QMessageBox msgBox;
+      msgBox.setText("That's all folks !\n\nThank you for your participation !");
+      msgBox.exec();
       QApplication::quit();
     }
   else