#include "ui_mainwindow.h" #include // #include #include #include #include #include #include "mainwindow.h" #include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { this->setFixedSize(1800 , 950); easyLocateInferenceWidget_ = new EasyLocateInferenceWidget; setCentralWidget(easyLocateInferenceWidget_); openEasyLocateToolAction_ = new QAction(tr("Open &EasyLocate tool..."), this); openEasyLocateToolAction_->setStatusTip(tr("Load a EasyLocate tool")); connect(openEasyLocateToolAction_, &QAction::triggered, this, &MainWindow::onOpenEasyLocateToolAction); quitAction_ = new QAction(tr("&Quit..."), this); quitAction_->setShortcuts(QKeySequence::Quit); quitAction_->setStatusTip(tr("Quit application")); connect(quitAction_, &QAction::triggered, this, &QApplication::quit); fileMenu_ = menuBar()->addMenu(tr("&File")); fileMenu_->addAction(openEasyLocateToolAction_); separatorAct_ = fileMenu_->addSeparator(); fileMenu_->addSeparator(); fileMenu_->addAction(quitAction_); applicationIntroductionAction_ = new QAction(tr("Application introduction..."), this); applicationIntroductionAction_->setStatusTip(tr("Show application introduction dialog")); connect(applicationIntroductionAction_, &QAction::triggered, this, &MainWindow::onApplicationIntroductionAction); helpMenu_ = menuBar()->addMenu(tr("&Help")); helpMenu_->addAction(applicationIntroductionAction_); } MainWindow::~MainWindow() { delete ui; this->close(); } void MainWindow::onOpenEasyLocateToolAction() { QString filename = QFileDialog::getOpenFileName(this, "EasyLocate Tool file", QString(), "EasyLocate tool file (*.ecl)"); if (!filename.isEmpty()) { easyLocateInferenceWidget_->loadLocator(filename); update(); } } void MainWindow::onApplicationIntroductionAction() { QMessageBox::information( this, "Application introduction", "Load a trained EasyLocate tool and an image. \n" "A trained EasyLocate tool for the \"Electronic Components Bag\" dataset is available in the Additional Resources of the Open eVision download area. \n" "The objects will be automatically detected and displayed.\n" "\n" "Use \"Open folder...\" to open a folder that containing a list of images, click on the image will process the next one.\n" "\n" "Required license : EasyLocate\n" ); } void MainWindow::onNextImageFolder() { ++imageListFilesIndex_; }