Skip to content
Snippets Groups Projects
Commit f6e7f821 authored by simon.fanetti's avatar simon.fanetti
Browse files

add screenshot of screens in setupapp + adjust destructors

parent 2664c84d
Branches
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ BeamerLocationGui::BeamerLocationGui(SandboxSetup *_setup, MonitorGui *_mg, QWid
BeamerLocationGui::~BeamerLocationGui()
{
delete timer;
delete winFullScreen;
delete ui;
}
......
......@@ -16,6 +16,7 @@ CameraFocus::CameraFocus(SandboxSetup *sandbox, QWidget *parent) :
CameraFocus::~CameraFocus()
{
delete frameTimer;
delete ui;
}
......
......@@ -20,6 +20,8 @@ CroppingMask::CroppingMask(SandboxSetup *sandbox, MonitorGui *_mg, QWidget *pare
CroppingMask::~CroppingMask()
{
delete projBlueScreen;
delete maskEdit;
delete ui;
}
......
......@@ -32,9 +32,10 @@ InitCamera::InitCamera(SandboxSetup *_setup, QWidget *parent) :
InitCamera::~InitCamera()
{
delete ui;
workerThread->quit();
workerThread->wait();
delete workerThread;
delete ui;
}
void InitCamera::showEvent(QShowEvent *event){
......
......@@ -36,6 +36,14 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
delete scfg;
delete bl;
delete cm;
delete cf;
delete pg;
delete mg;
delete init;
delete setup;
delete ui;
}
......
......@@ -22,11 +22,13 @@ MonitorGui::MonitorGui(SandboxSetup *_setup, QWidget *parent) :
if(screens.size() > 0){
loadResolutionsOf(screens[0]);
showMonitorsScreenshot(screens[0]);
}
}
MonitorGui::~MonitorGui()
{
delete resolution;
delete ui;
}
......@@ -73,7 +75,9 @@ QScreen* MonitorGui::getMonitor(){
void MonitorGui::on_cbxOutputs_currentIndexChanged(int index)
{
QList<QScreen*> screens = QApplication::screens();
loadResolutionsOf(screens[index]);
QScreen *sc = screens[index];
loadResolutionsOf(sc);
showMonitorsScreenshot(sc);
}
......@@ -139,3 +143,8 @@ void MonitorGui::loadResolutionsFromFile(std::string path){
}
}
}
void MonitorGui::showMonitorsScreenshot(QScreen *screen){
QPixmap px = screen->grabWindow(0);
ui->lblScreenshot->setPixmap(px);
}
......@@ -53,6 +53,7 @@ private:
bool isResolution(std::string s);
void loadResolutionsFromFile(std::string path);
void initMonitorMapWithFile(std::string path);
void showMonitorsScreenshot(QScreen *screen);
};
#endif // MONITORGUI_H
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<width>617</width>
<height>300</height>
</rect>
</property>
......@@ -59,6 +59,22 @@
</rect>
</property>
</widget>
<widget class="QLabel" name="lblScreenshot">
<property name="geometry">
<rect>
<x>300</x>
<y>50</y>
<width>291</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
......
......@@ -23,6 +23,8 @@ void ProjectionGui::closeEvent(QCloseEvent *event){
ProjectionGui::~ProjectionGui()
{
delete frameTimer;
delete blueScreen;
delete ui;
}
......
......@@ -14,6 +14,12 @@ QtFullScreen::QtFullScreen(QRect _resolution, bool _isBorderless, QWidget *paren
image->setScaledContents(true);
}
QtFullScreen::~QtFullScreen()
{
delete image;
delete win;
}
void QtFullScreen::showEvent(QShowEvent* event){
QWidget::showEvent( event );
......
......@@ -12,6 +12,7 @@ class QtFullScreen : public QWidget
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment