|
@@ -28,25 +28,71 @@ MainWindow::MainWindow ()
|
|
|
setCentralWidget (central);
|
|
|
setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
|
- QHBoxLayout *layout = new QHBoxLayout(central);
|
|
|
- layout->setSpacing(0);
|
|
|
- layout->setContentsMargins(0, 0, 0, 0);
|
|
|
- central->setLayout(layout);
|
|
|
+ QVBoxLayout *layoutV = new QVBoxLayout(central);
|
|
|
+ layoutV->setSpacing(0);
|
|
|
+ layoutV->setContentsMargins(0, 0, 0, 0);
|
|
|
+ central->setLayout(layoutV);
|
|
|
+
|
|
|
+ // First line of the interface
|
|
|
+ QHBoxLayout *layoutH1 = new QHBoxLayout(central);
|
|
|
+ layoutH1->setSpacing(0);
|
|
|
+ layoutH1->setContentsMargins(0, 0, 0, 0);
|
|
|
+ layoutV->addLayout(layoutH1);
|
|
|
|
|
|
- waLeft = new WorkArea (((screenWidth-spaceInBetween)/2), screenHeight, this);
|
|
|
+ waLeft = new WorkArea (((screenWidth-spaceInBetween)/2), screenHeight, central);
|
|
|
waLeft->setContentsMargins(0, 0, 0, 0);
|
|
|
- layout->addWidget(waLeft);
|
|
|
+ layoutH1->addWidget(waLeft);
|
|
|
|
|
|
- QWidget *wSpaceInBetween = new QWidget();
|
|
|
- wSpaceInBetween->setContentsMargins(0, 0, 0, 0);
|
|
|
- wSpaceInBetween->setFixedSize(spaceInBetween,0);
|
|
|
- layout->addWidget(wSpaceInBetween);
|
|
|
+ QWidget *w1SpaceInBetween = new QWidget(central);
|
|
|
+ w1SpaceInBetween->setContentsMargins(0, 0, 0, 0);
|
|
|
+ w1SpaceInBetween->setFixedSize(spaceInBetween,0);
|
|
|
+ layoutH1->addWidget(w1SpaceInBetween);
|
|
|
|
|
|
- waRight = new WorkArea ((screenWidth/2), screenHeight, this);
|
|
|
+ waRight = new WorkArea (((screenWidth-spaceInBetween)/2), screenHeight, central);
|
|
|
waRight->setContentsMargins(0, 0, 0, 0);
|
|
|
- layout->addWidget(waRight);
|
|
|
+ layoutH1->addWidget(waRight);
|
|
|
+
|
|
|
+ // second line of interface
|
|
|
+ QWidget *hSpaceInBetween = new QWidget(central);
|
|
|
+ hSpaceInBetween->setContentsMargins(0, 0, 0, 0);
|
|
|
+ hSpaceInBetween->setFixedSize(0, spaceInBetween);
|
|
|
+ layoutV->addWidget(hSpaceInBetween);
|
|
|
+
|
|
|
+ // third line of interface
|
|
|
+ QHBoxLayout *layoutH2 = new QHBoxLayout(central);
|
|
|
+ layoutH2->setSpacing(0);
|
|
|
+ layoutH2->setContentsMargins(0, 0, 0, 0);
|
|
|
+ layoutV->addLayout(layoutH2);
|
|
|
+
|
|
|
+ leftButton = new QPushButton("Image de gauche", central);
|
|
|
+ leftButton->setFixedHeight(30);
|
|
|
+ connect(leftButton, SIGNAL(clicked(bool)), this, SLOT(leftImage()));
|
|
|
+ layoutH2->addWidget(leftButton);
|
|
|
+
|
|
|
+ QWidget *w2SpaceInBetween = new QWidget();
|
|
|
+ w2SpaceInBetween->setContentsMargins(0, 0, 0, 0);
|
|
|
+ w2SpaceInBetween->setFixedSize(spaceInBetween,0);
|
|
|
+ layoutH2->addWidget(w2SpaceInBetween);
|
|
|
+
|
|
|
+ rightButton = new QPushButton("Image de droite", central);
|
|
|
+ rightButton->setFixedHeight(30);
|
|
|
+ connect(rightButton, SIGNAL(clicked(bool)), this, SLOT(rightImage()));
|
|
|
+ layoutH2->addWidget(rightButton);
|
|
|
+
|
|
|
+ // Fourth line of the interface
|
|
|
+ progressBar = new QProgressBar(central);
|
|
|
+ progressBar->setFixedHeight(20);
|
|
|
+ layoutV->addWidget(progressBar);
|
|
|
|
|
|
setFixedSize (screenWidth, screenHeight);
|
|
|
+
|
|
|
+ /*POUR TEST*/
|
|
|
+
|
|
|
+ QString img_a_ouvrir("/home/remi/images/screenshot.png");
|
|
|
+ QString sl1_a_ouvrir("/home/remi/images/screenshot.txt");
|
|
|
+ QString sl2_a_ouvrir("/home/remi/images/screenshotb.txt");
|
|
|
+
|
|
|
+ openC( img_a_ouvrir, sl1_a_ouvrir, sl2_a_ouvrir);
|
|
|
}
|
|
|
|
|
|
void
|
|
@@ -77,6 +123,14 @@ MainWindow::open ()
|
|
|
openC(imageFilename, SLLeftFilename, SLRightFilename);
|
|
|
}
|
|
|
|
|
|
+void MainWindow::leftImage(){
|
|
|
+ qDebug() << "Clic sur image gauche" << Qt::endl;
|
|
|
+}
|
|
|
+
|
|
|
+void MainWindow::rightImage(){
|
|
|
+ qDebug() << "Clic sur image droite" << Qt::endl;
|
|
|
+}
|
|
|
+
|
|
|
void
|
|
|
MainWindow::openC (QString image, QString leftSL, QString rightSL){
|
|
|
waLeft->loadImage (image.toStdString ());
|
|
@@ -85,7 +139,7 @@ MainWindow::openC (QString image, QString leftSL, QString rightSL){
|
|
|
waRight->loadSL(rightSL.toStdString());
|
|
|
waLeft->setReadOnly(true);
|
|
|
waRight->setReadOnly(true);
|
|
|
- setFixedSize (waLeft->geometry().width()*2+spaceInBetween, waLeft->geometry().height()+waLeft->geometry().y()+22); // +22 ??!!
|
|
|
+ setFixedSize (waLeft->geometry().width()*2+spaceInBetween, waLeft->geometry().height()+waLeft->geometry().y()+spaceInBetween+leftButton->geometry().height()+22); // +22 ??!!
|
|
|
}
|
|
|
|
|
|
void
|