From 1faf86c3da12c1712e1d5ec015721d9aa02f8672 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 26 Jul 2022 16:32:18 +0200 Subject: [PATCH] Gui: Use new-style syntax of connect() When fixing clazy issues -Wclazy-fully-qualified-moc-types then old-style syntax of connect() may fail. Thus, replace it with the new-style syntax --- src/Gui/MDIView.h | 3 +++ src/Gui/MainWindow.cpp | 13 +++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Gui/MDIView.h b/src/Gui/MDIView.h index 3ac83a5e8d..7e9fd6c06c 100644 --- a/src/Gui/MDIView.h +++ b/src/Gui/MDIView.h @@ -36,6 +36,7 @@ QT_END_NAMESPACE namespace Gui { class Document; +class MainWindow; class ViewProvider; class ViewProviderDocumentObject; @@ -182,6 +183,8 @@ private: ActiveObjectList ActiveObjects; typedef boost::signals2::connection Connection; Connection connectDelObject; //remove active object upon delete. + + friend class MainWindow; }; } // namespace Gui diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index e8d55876e2..f62d14c768 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -876,10 +876,8 @@ void MainWindow::addWindow(MDIView* view) d->mdiArea->addSubWindow(child); } - connect(view, SIGNAL(message(const QString&, int)), - this, SLOT(showMessage(const QString&, int))); - connect(this, SIGNAL(windowStateChanged(MDIView*)), - view, SLOT(windowStateChanged(MDIView*))); + connect(view, &MDIView::message, this, &MainWindow::showMessage); + connect(this, &MainWindow::windowStateChanged, view, &MDIView::windowStateChanged); // listen to the incoming events of the view view->installEventFilter(this); @@ -900,10 +898,9 @@ void MainWindow::addWindow(MDIView* view) void MainWindow::removeWindow(Gui::MDIView* view, bool close) { // free all connections - disconnect(view, SIGNAL(message(const QString&, int)), - this, SLOT(showMessage(const QString&, int ))); - disconnect(this, SIGNAL(windowStateChanged(MDIView*)), - view, SLOT(windowStateChanged(MDIView*))); + disconnect(view, &MDIView::message, this, &MainWindow::showMessage); + disconnect(this, &MainWindow::windowStateChanged, view, &MDIView::windowStateChanged); + view->removeEventFilter(this); // check if the focus widget is a child of the view