mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-04-15 12:09:24 +02:00
Manage close event (unchecks the menu item in main window)
This commit is contained in:
@@ -677,6 +677,7 @@ void MainWindow::createLayout()
|
||||
// Output changed -> change destinatioin
|
||||
connect(outputWindow->getCanvas(), SIGNAL(shapeChanged(Shape*)),
|
||||
destinationCanvas, SLOT(updateCanvas()));
|
||||
|
||||
// connect(destinationCanvas, SIGNAL(imageChanged()),
|
||||
// sourceCanvas, SLOT(updateCanvas()));
|
||||
|
||||
@@ -830,8 +831,13 @@ void MainWindow::createActions()
|
||||
displayOutputWindow->setStatusTip(tr("Display output window"));
|
||||
displayOutputWindow->setCheckable(true);
|
||||
displayOutputWindow->setChecked(true);
|
||||
|
||||
// Manage show/hide of GL output window.
|
||||
connect(displayOutputWindow, SIGNAL(toggled(bool)), this, SLOT(toggleOutputWindow(bool)));
|
||||
|
||||
// When closing the GL output window, uncheck the action in menu.
|
||||
connect(outputWindow, SIGNAL(closed()), displayOutputWindow, SLOT(toggle()));
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::createMenus()
|
||||
|
||||
@@ -35,6 +35,12 @@ OutputGLWindow::OutputGLWindow(QWidget* parent, const QGLWidget * shareWidget) :
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
void OutputGLWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
emit closed();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//void OutputGLWindow::updateCanvas() {
|
||||
// qDebug() << "Update output canvas" << endl;
|
||||
// canvas->updateCanvas();
|
||||
|
||||
@@ -28,11 +28,16 @@
|
||||
//since we dont want this window to be closed by the user
|
||||
class OutputGLWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OutputGLWindow(QWidget* parent = 0, const QGLWidget * shareWidget = 0);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *){}
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
public:
|
||||
DestinationGLCanvas* getCanvas() const { return canvas; }
|
||||
|
||||
Reference in New Issue
Block a user