|
@@ -82,7 +82,15 @@ MainWindow::MainWindow ()
|
|
|
// Fourth line of the interface
|
|
|
progressBar = new QProgressBar(central);
|
|
|
progressBar->setFixedHeight(20);
|
|
|
+ progressBar->setRange(0, maxProgressBar);
|
|
|
+ progressBar->setValue(0);
|
|
|
+ connect(progressBar, SIGNAL(valueChanged(int)), this, SLOT(progressBarValueChanged(int)));
|
|
|
layoutV->addWidget(progressBar);
|
|
|
+
|
|
|
+ timer = new QTimer(central);
|
|
|
+ timer->setSingleShot(false);
|
|
|
+ timer->setInterval(time);
|
|
|
+ connect(timer, SIGNAL(timeout()), this, SLOT(ticTimer()));
|
|
|
|
|
|
setFixedSize (screenWidth, screenHeight);
|
|
|
|
|
@@ -93,6 +101,8 @@ MainWindow::MainWindow ()
|
|
|
QString sl2_a_ouvrir("/home/remi/images/screenshotb.txt");
|
|
|
|
|
|
openC( img_a_ouvrir, sl1_a_ouvrir, sl2_a_ouvrir);
|
|
|
+
|
|
|
+ timer->start();
|
|
|
}
|
|
|
|
|
|
void
|
|
@@ -131,6 +141,16 @@ void MainWindow::rightImage(){
|
|
|
qDebug() << "Clic sur image droite" << Qt::endl;
|
|
|
}
|
|
|
|
|
|
+void MainWindow::progressBarValueChanged(int value){
|
|
|
+ if(value == maxProgressBar ){
|
|
|
+ QApplication::quit();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void MainWindow::ticTimer(){
|
|
|
+ progressBar->setValue(progressBar->value()+time);
|
|
|
+}
|
|
|
+
|
|
|
void
|
|
|
MainWindow::openC (QString image, QString leftSL, QString rightSL){
|
|
|
waLeft->loadImage (image.toStdString ());
|