From f9ea06a9d7bb695b60b3338d6946092d05e436b2 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 13 May 2014 18:34:52 +0400 Subject: [PATCH] Issue #8: Fix for delete view event --- src/XGUI/XGUI_MainWindow.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp index 02971608f..a0cefc1d3 100644 --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -40,11 +40,15 @@ XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) aMdiArea->addAction(aAction); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(cascadeWindows())); + aAction = new QAction(aMdiArea); + aAction->setSeparator(true); + aMdiArea->addAction(aAction); + myViewer = new XGUI_Viewer(this); connect(myViewer, SIGNAL(viewCreated(XGUI_ViewWindow*)), this, SLOT(onViewCreated(XGUI_ViewWindow*))); connect(myViewer, SIGNAL(deleteView(XGUI_ViewWindow*)), - this, SLOT(onViewCreated(XGUI_ViewWindow*))); + this, SLOT(onDeleteView(XGUI_ViewWindow*))); } XGUI_MainWindow::~XGUI_MainWindow(void) @@ -129,13 +133,8 @@ void XGUI_MainWindow::onViewCreated(XGUI_ViewWindow* theWindow) { QWidget* aSubWindow = theWindow->parentWidget(); QWidget* aMDIWidget = centralWidget(); - QAction* aAction; - if (aMDIWidget->actions().size() == 3) { - aAction = new QAction(aMDIWidget); - aAction->setSeparator(true); - aMDIWidget->addAction(aAction); - } - aAction = new QAction(aSubWindow->windowTitle(), aMDIWidget); + + QAction* aAction = new QAction(aSubWindow->windowTitle(), aMDIWidget); aAction->setCheckable(true); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(activateView())); aMDIWidget->addAction(aAction); -- 2.39.2