MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->showNormal(); myPlayer = new player(); /*********choose and show video******************/ QObject::connect(ui->actionOuvrirVideo, SIGNAL(triggered()), this, SLOT(chooseVideo())); QObject::connect(myPlayer, SIGNAL(processedImage(QImage, QString)), this, SLOT(updatePlayerUI(QImage, QString))); /***********************************************/ /*****For choose object**************/ ui->VideoLbl->setMouseTracking(true); QObject::connect(ui->VideoLbl, SIGNAL(Mouse_Move(int, int)), this, SLOT(myMouseMove(int, int))); QObject::connect(ui->VideoLbl, SIGNAL(Mouse_Pressed(int,int)), this, SLOT(myMousePressed(int, int))); QObject::connect(ui->VideoLbl, SIGNAL(Mouse_Left(int, int)), this, SLOT(myMouseLeft(int, int))); QObject::connect(ui->VideoLbl, SIGNAL(Mouse_Move_Pressed(int,int)), this, SLOT(myMouseMovePressed(int, int))); /************************************/ /***Set Button et Slider disabled****/ ui->playBtn->setEnabled(false); ui->backwardButton->setEnabled(false); ui->forwardButton->setEnabled(false); ui->videoSlider->setEnabled(false); ui->quickbackwardButton->setEnabled(false); ui->quickforwardButton->setEnabled(false); ui->trajectoirecheckBox->setEnabled(false); ui->debutButton->setEnabled(false); ui->finButton->setEnabled(false); ui->ouvrirButton->setVisible(false); ui->savefinButton->setEnabled(false); ui->VideoLbl->setEnabled(false); /***********************************/ ui->actionInformationObjet->setEnabled(false); /*************open dialog**************/ QObject::connect(ui->actionInformationObjet, SIGNAL(triggered()),this, SLOT(openInformationDialog())); QObject::connect(ui->actionDeplacement, SIGNAL(triggered()),this, SLOT(openDeplacementDialog())); /**************************************/ /******Initialisation******************/ start = 0; fin = 0; /*************************************/ }
// The constructor MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { // Create the Player object myPlayer = new Player(); // Processing the images by connecting the signal and the slot QObject::connect(myPlayer, SIGNAL(processedImage(QImage)), this, SLOT(updatePlayerUI(QImage))); // Set up the UI's label ui->setupUi(this); // Set up the webView of the UI ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true); ui->webView->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled,true); ui->webView->settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled,true); ui->webView->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true); ui->webView->settings()->setAttribute(QWebSettings::LocalStorageEnabled,true); ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard,true); ui->webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled,true); ui->webView->settings()->setAttribute(QWebSettings::CanvasPathEnabled, true); ui->webView->load(QUrl("file:///home/brian/Documents/C%20and%20C++%20Program/GuiWebcam/map.html")); }