diff --git a/app/SandboxSetup/beamerlocationgui.cpp b/app/SandboxSetup/beamerlocationgui.cpp index 644e1decb4ec5e132cf39115ec0f67c3e3aec274..f0bc3a34c72ee32fbf49d0d055ddc2460153a5eb 100644 --- a/app/SandboxSetup/beamerlocationgui.cpp +++ b/app/SandboxSetup/beamerlocationgui.cpp @@ -48,7 +48,7 @@ void BeamerLocationGui::showEvent(QShowEvent *event){ QWidget::showEvent(event); if(!isFullScreenInit){ - winFullScreen->setGeometry(mg->getResolution()); + winFullScreen->editGeometry(mg->getResolution()); } crosses = beamer->getCrossList(); startRoutine(); diff --git a/app/SandboxSetup/beamerlocationgui.ui b/app/SandboxSetup/beamerlocationgui.ui index b414ddd0629a944f7961faa9d516ec6fab6e64d3..092fa9252624f9866ab7548d1cb7c79d96885ff0 100644 --- a/app/SandboxSetup/beamerlocationgui.ui +++ b/app/SandboxSetup/beamerlocationgui.ui @@ -16,7 +16,7 @@ <widget class="QPushButton" name="btnLock"> <property name="geometry"> <rect> - <x>220</x> + <x>240</x> <y>570</y> <width>131</width> <height>51</height> @@ -42,10 +42,10 @@ <widget class="QTextEdit" name="txtInstructions"> <property name="geometry"> <rect> - <x>50</x> + <x>40</x> <y>360</y> - <width>521</width> - <height>181</height> + <width>541</width> + <height>201</height> </rect> </property> <property name="readOnly"> @@ -61,7 +61,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - Repeat this process 3 times for each cross you see (there will be 3 different crosses)</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Note :</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - The cross will change from red to green when it detects the target.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - The little square at the center will change from red to green when it detects the target.</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - For each point you validate, change the height of your target to not save the same position twice in the process.</p></body></html></string> </property> </widget> diff --git a/app/SandboxSetup/camerafocus.cpp b/app/SandboxSetup/camerafocus.cpp index 252850e695a6c001aff50022e32c94e9ec4213b1..73af3992223cc3e5b79f336ccdce92a714eac7bb 100644 --- a/app/SandboxSetup/camerafocus.cpp +++ b/app/SandboxSetup/camerafocus.cpp @@ -48,7 +48,7 @@ void CameraFocus::showEvent(QShowEvent *event){ QWidget::showEvent(event); cv::Mat black = cv::Mat(1, 1, CV_8UC3, cv::Scalar(0, 0, 0)); - blackScreen->setGeometry(mg->getResolution()); + blackScreen->editGeometry(mg->getResolution()); blackScreen->imShow(black); frameTimer->start(100); } diff --git a/app/SandboxSetup/croppingmask.cpp b/app/SandboxSetup/croppingmask.cpp index 0409417b42a0169aa65d23616e3cf5f5125bb52e..7d060c11b08a95f1c21a3c6d00806b8be424a11b 100644 --- a/app/SandboxSetup/croppingmask.cpp +++ b/app/SandboxSetup/croppingmask.cpp @@ -49,7 +49,7 @@ void CroppingMask::showEvent(QShowEvent *event){ // show blue screen if(!blueScreenInitilized){ blueScreenInitilized = true; - blueScreen->setGeometry(mg->getResolution()); + blueScreen->editGeometry(mg->getResolution()); } cv::Mat blueMat = cv::Mat(1, 1, CV_8UC3, cv::Scalar(0, 0, 255)); blueScreen->imShow(blueMat); diff --git a/app/SandboxSetup/mainwindow.cpp b/app/SandboxSetup/mainwindow.cpp index 408cfa77bf85684a8939047c0a37f760f84e3d95..0f17b0dbc3c506b746eec5902a74710d21ab1d99 100644 --- a/app/SandboxSetup/mainwindow.cpp +++ b/app/SandboxSetup/mainwindow.cpp @@ -31,7 +31,7 @@ MainWindow::MainWindow(QWidget *parent) : for(SubApp* app : applist){ connect(app, &SubApp::sendNotif, this, &MainWindow::receiveNotif); } - + this->setFocusPolicy(Qt::StrongFocus); } MainWindow::~MainWindow() diff --git a/app/SandboxSetup/mainwindow.ui b/app/SandboxSetup/mainwindow.ui index 0b29eb8db97dd3062fe6ffb15b9c22f254ddec44..1bed0271cfb6027a6a18489b3fa480750749c02f 100644 --- a/app/SandboxSetup/mainwindow.ui +++ b/app/SandboxSetup/mainwindow.ui @@ -2,6 +2,9 @@ <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> + <property name="windowModality"> + <enum>Qt::NonModal</enum> + </property> <property name="geometry"> <rect> <x>0</x> diff --git a/app/SandboxSetup/projectiongui.cpp b/app/SandboxSetup/projectiongui.cpp index c7c8dcd70816d5fa2eca85e86a02e04c9b856fca..f2a9a46a8c0b14e3de262365720367f1555e70ad 100644 --- a/app/SandboxSetup/projectiongui.cpp +++ b/app/SandboxSetup/projectiongui.cpp @@ -42,7 +42,7 @@ void ProjectionGui::on_btnStart_clicked() if(!cameraUsed){ // open blue screen on the selected output cv::Mat blue = cv::Mat(1, 1, CV_8UC3, cv::Scalar(0, 0, 255)); - blueScreen->setGeometry(mg->getResolution()); + blueScreen->editGeometry(mg->getResolution()); blueScreen->imShow(blue); cameraUsed = true; frameTimer->start(100); diff --git a/app/SandboxSetup/qtfullscreen.cpp b/app/SandboxSetup/qtfullscreen.cpp index 62849ea85ba38889a84bf32904fcd574be04164d..e51a3c4f156d8855a887d570892615aab8720b83 100644 --- a/app/SandboxSetup/qtfullscreen.cpp +++ b/app/SandboxSetup/qtfullscreen.cpp @@ -1,35 +1,28 @@ #include "qtfullscreen.h" -QtFullScreen::QtFullScreen(QRect reso, bool _isBorderless, QWidget *parent) : QObject() +QtFullScreen::QtFullScreen(QRect reso, bool _isBorderless, QWidget *parent) : QDialog(parent) { - p = parent; + image = new QLabel(this); + image->setScaledContents(true); resolution = new QRect(reso.left(), reso.top(), reso.width(), reso.height()); isBorderless = _isBorderless; - - win = new QDialog(parent); - win->setWindowFlags(Qt::Window); - win->setFocusPolicy(Qt::NoFocus); - win->setGeometry(*resolution); - - image = new QLabel(win); - image->setGeometry(0, 0 , win->geometry().width(), win->geometry().height()); - image->setScaledContents(true); + this->setAttribute(Qt::WA_ShowWithoutActivating); + editGeometry(*resolution); } QtFullScreen::~QtFullScreen() { - delete image; - delete win; delete resolution; + delete image; } -void QtFullScreen::setGeometry(QRect reso){ - setGeometry(reso.x(), reso.y(), reso.width(), reso.height()); +void QtFullScreen::editGeometry(QRect reso){ + editGeometry(reso.x(), reso.y(), reso.width(), reso.height()); } -void QtFullScreen::setGeometry(int x, int y, int w, int h){ - win->setGeometry(x, y, w, h); +void QtFullScreen::editGeometry(int x, int y, int w, int h){ + this->setGeometry(x, y, w, h); image->setGeometry(0 , 0, w, h); } @@ -39,20 +32,11 @@ void QtFullScreen::imShow(cv::Mat frame){ QPixmap px = QPixmap::fromImage(src); image->setPixmap(px); - if(!win->isVisible()){ + if(!this->isVisible()){ if(isBorderless){ - win->showFullScreen(); + this->showFullScreen(); }else{ - win->show(); + this->show(); } } - - if(p != nullptr) - p->setFocus(); - -} - -void QtFullScreen::close(){ - if(win->isVisible()) - win->close(); } diff --git a/app/SandboxSetup/qtfullscreen.h b/app/SandboxSetup/qtfullscreen.h index c42dd50609278f1ac477379825e2db735722a0ac..acf655a7a5406ac6c93a33b11bcd15c494106839 100644 --- a/app/SandboxSetup/qtfullscreen.h +++ b/app/SandboxSetup/qtfullscreen.h @@ -4,26 +4,22 @@ #include <opencv2/opencv.hpp> #include <QWidget> #include <QLabel> -#include <QScreen> #include <QDialog> +#include <QTimer> -class QtFullScreen : public QObject +class QtFullScreen : public QDialog { Q_OBJECT public: explicit QtFullScreen(QRect resolution, bool isBorderless=false, QWidget *parent = nullptr); ~QtFullScreen(); void imShow(cv::Mat frame); - void close(); - void setGeometry(QRect resolution); - void setGeometry(int x, int y, int w, int h); + void editGeometry(QRect resolution); + void editGeometry(int x, int y, int w, int h); private: - QDialog *win; QLabel *image; - QScreen *screen; QRect *resolution; - QWidget *p; bool isBorderless = false; };