From 080923d7125b2c103af4be059e883e2a47ebdb71 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Fri, 6 Nov 2020 18:07:17 +0000 Subject: [PATCH 01/23] start work on close all but this --- include/SubWindow.h | 2 ++ src/gui/SubWindow.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/SubWindow.h b/include/SubWindow.h index 55d05425ab8..882c8c3ad5c 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -89,6 +89,8 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow QLabel * m_windowTitle; QGraphicsDropShadowEffect * m_shadow; bool m_hasFocus; + QMenu* m_systemMenu; + QAction* m_closeOthersAction; static void elideText( QLabel *label, QString text ); void adjustTitleBar(); diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 5cbac4cd6fa..fc1a10c5b9b 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "embed.h" @@ -93,6 +94,12 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint ); connect( mdiArea(), SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( focusChanged( QMdiSubWindow* ) ) ); + + // alter the default systemMenu + m_systemMenu = systemMenu(); + m_closeOthersAction = new QAction(); + m_systemMenu->addAction(m_closeOthersAction); + setSystemMenu(m_systemMenu); } From 6742d12a9f6e35167f2a71a32b71335dd5353fd4 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 7 Nov 2020 22:10:34 +0000 Subject: [PATCH 02/23] work on action --- src/gui/SubWindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index fc1a10c5b9b..c7c8a8f3cdd 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -95,10 +95,16 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : Qt::CustomizeWindowHint ); connect( mdiArea(), SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( focusChanged( QMdiSubWindow* ) ) ); - // alter the default systemMenu + // get the default systemMenu m_systemMenu = systemMenu(); + // create 'close all but this' action m_closeOthersAction = new QAction(); + m_closeOthersAction->setText("Close all but this"); + m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + connect(m_closeOthersAction, &QAction::triggered, this, this->close()); + // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); + // update systemMenu setSystemMenu(m_systemMenu); } From ea2aca952cbf8d1fa5c4120f9f7c1a7360f156a3 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 8 Nov 2020 22:54:09 +0000 Subject: [PATCH 03/23] comment this out for now --- src/gui/SubWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index c7c8a8f3cdd..bfd9636cb26 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -101,7 +101,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeOthersAction = new QAction(); m_closeOthersAction->setText("Close all but this"); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - connect(m_closeOthersAction, &QAction::triggered, this, this->close()); + //connect(m_closeOthersAction, &QAction::trigger, this, this->close()); // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); // update systemMenu From 385a544ade3105472bc1add8529bc17a1b4e9715 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 22 Nov 2020 17:47:06 +0000 Subject: [PATCH 04/23] get this working --- src/gui/SubWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index bfd9636cb26..df2fee32b65 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -101,7 +101,8 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeOthersAction = new QAction(); m_closeOthersAction->setText("Close all but this"); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - //connect(m_closeOthersAction, &QAction::trigger, this, this->close()); + //const QWidgetList x = QApplication::topLevelWidgets(); + connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::close); // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); // update systemMenu From 33c3fca64353c8b4c1b1d2a5a24893bf266d86a3 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 22 Nov 2020 22:25:48 +0000 Subject: [PATCH 05/23] start work on emitCloseOthersSignal --- include/SubWindow.h | 2 ++ src/gui/SubWindow.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/SubWindow.h b/include/SubWindow.h index 882c8c3ad5c..3d144abd70c 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -74,6 +74,7 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow signals: void focusLost(); + void closeOthers(); private: const QSize m_buttonSize; @@ -97,6 +98,7 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow private slots: void focusChanged( QMdiSubWindow * subWindow ); + void emitCloseOthersSignal(); }; #endif diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index df2fee32b65..e870054e58c 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -101,8 +101,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeOthersAction = new QAction(); m_closeOthersAction->setText("Close all but this"); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - //const QWidgetList x = QApplication::topLevelWidgets(); - connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::close); + connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); // update systemMenu @@ -390,3 +389,10 @@ void SubWindow::resizeEvent( QResizeEvent * event ) m_trackedNormalGeom.setSize( event->size() ); } } + + + +void SubWindow::emitCloseOthersSignal() +{ + emit closeOthers(); +} \ No newline at end of file From ef151453d773cb50d20fc813deb9ec5f3945c51b Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 15:48:14 +0000 Subject: [PATCH 06/23] use SIGNAL and SLOT notation --- src/gui/SubWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index e870054e58c..4aba6bdc313 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -102,6 +102,9 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeOthersAction->setText("Close all but this"); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); + connect(m_closeOthersAction, SIGNAL(triggered(QAction*)), this, SLOT(emitCloseOthersSignal(SubWindow*))); + //connect(this, &SubWindow::closeOthers, this, close); + connect(this, SIGNAL(closeOthers(SubWindow*)), this, SLOT(close())); // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); // update systemMenu From 99cf0f953fa99ba4286a1c33ce3da1e0fa26ee4f Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 15:56:36 +0000 Subject: [PATCH 07/23] fix connect() --- src/gui/SubWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 4aba6bdc313..a91680aa5a9 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -101,10 +101,10 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeOthersAction = new QAction(); m_closeOthersAction->setText("Close all but this"); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); - connect(m_closeOthersAction, SIGNAL(triggered(QAction*)), this, SLOT(emitCloseOthersSignal(SubWindow*))); + //connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); + connect(m_closeOthersAction, SIGNAL(triggered()), this, SLOT(emitCloseOthersSignal())); //connect(this, &SubWindow::closeOthers, this, close); - connect(this, SIGNAL(closeOthers(SubWindow*)), this, SLOT(close())); + connect(this, SIGNAL(closeOthers()), this, SLOT(close())); // add action to systemMenu m_systemMenu->addAction(m_closeOthersAction); // update systemMenu From d57693c12bc22ef011c3dd0e305e834a79e913aa Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 16:10:37 +0000 Subject: [PATCH 08/23] rename --- include/SubWindow.h | 4 +--- src/gui/SubWindow.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/SubWindow.h b/include/SubWindow.h index 3d144abd70c..accf89e78c1 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -74,7 +74,6 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow signals: void focusLost(); - void closeOthers(); private: const QSize m_buttonSize; @@ -91,14 +90,13 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow QGraphicsDropShadowEffect * m_shadow; bool m_hasFocus; QMenu* m_systemMenu; - QAction* m_closeOthersAction; + QAction* m_closeAllAction; static void elideText( QLabel *label, QString text ); void adjustTitleBar(); private slots: void focusChanged( QMdiSubWindow * subWindow ); - void emitCloseOthersSignal(); }; #endif diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index a91680aa5a9..7654965ae35 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -97,16 +97,19 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // get the default systemMenu m_systemMenu = systemMenu(); - // create 'close all but this' action - m_closeOthersAction = new QAction(); - m_closeOthersAction->setText("Close all but this"); - m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + + // create 'close all' action + m_closeAllAction = new QAction(); + m_closeAllAction->setText("Close all"); + m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + // connect action to signal //connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); - connect(m_closeOthersAction, SIGNAL(triggered()), this, SLOT(emitCloseOthersSignal())); + connect(m_closeAllAction, SIGNAL(triggered()), this, SLOT(emitCloseOthersSignal())); //connect(this, &SubWindow::closeOthers, this, close); connect(this, SIGNAL(closeOthers()), this, SLOT(close())); // add action to systemMenu - m_systemMenu->addAction(m_closeOthersAction); + m_systemMenu->addAction(m_closeAllAction); + // update systemMenu setSystemMenu(m_systemMenu); } From 3d41ccb6acb312c09c9e67870f2298604163165b Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 17:07:39 +0000 Subject: [PATCH 09/23] add signal sender --- include/SignalSender.h | 16 ++++++++++++++++ src/gui/SignalSender.cpp | 12 ++++++++++++ src/gui/SubWindow.cpp | 14 +++----------- 3 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 include/SignalSender.h create mode 100644 src/gui/SignalSender.cpp diff --git a/include/SignalSender.h b/include/SignalSender.h new file mode 100644 index 00000000000..7d4a712bc2d --- /dev/null +++ b/include/SignalSender.h @@ -0,0 +1,16 @@ +#ifndef SIGNALSENDER_H +#define SIGNALSENDER_H + +class SignalSender : public QObject +{ + Q_OBJECT + +public: + static SignalSender* getInstance(QObject* parent = 0); + void closeAll(); + +signals: + void closeAllSignal(); +}; + +#endif \ No newline at end of file diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp new file mode 100644 index 00000000000..8804d8fd477 --- /dev/null +++ b/src/gui/SignalSender.cpp @@ -0,0 +1,12 @@ +#include "SignalSender.h" + +static SignalSender* getInstance(QObject* parent = 0) +{ + static SignalSender* instance = new SignalSender(parent); + return instance; +} + +void closeAll() +{ + emit closeAllSignal(); +} \ No newline at end of file diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 7654965ae35..7f96fbfd76f 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -35,6 +35,7 @@ #include #include "embed.h" +#include "SignalSender.h" @@ -103,10 +104,8 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeAllAction->setText("Close all"); m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to signal - //connect(m_closeOthersAction, &QAction::triggered, this, &SubWindow::emitCloseOthersSignal); - connect(m_closeAllAction, SIGNAL(triggered()), this, SLOT(emitCloseOthersSignal())); - //connect(this, &SubWindow::closeOthers, this, close); - connect(this, SIGNAL(closeOthers()), this, SLOT(close())); + connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); + connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); // add action to systemMenu m_systemMenu->addAction(m_closeAllAction); @@ -394,11 +393,4 @@ void SubWindow::resizeEvent( QResizeEvent * event ) { m_trackedNormalGeom.setSize( event->size() ); } -} - - - -void SubWindow::emitCloseOthersSignal() -{ - emit closeOthers(); } \ No newline at end of file From 5c551b352dfc5b8b49e58ad8c5af49a72b3f4c3c Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 17:40:57 +0000 Subject: [PATCH 10/23] add signal sender to cmakelists --- src/gui/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 4b7018a5579..458b50db822 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -30,6 +30,7 @@ SET(LMMS_SRCS gui/PluginBrowser.cpp gui/RowTableView.cpp gui/SetupDialog.cpp + gui/SignalSender.cpp gui/StringPairDrag.cpp gui/SubWindow.cpp gui/TimeLineWidget.cpp From 960296d88a44c591d0c88c0eca7848c6dd35f2d4 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 18:08:29 +0000 Subject: [PATCH 11/23] remove QObject --- include/SignalSender.h | 4 +++- src/gui/SignalSender.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index 7d4a712bc2d..74964ee9287 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -1,12 +1,14 @@ #ifndef SIGNALSENDER_H #define SIGNALSENDER_H +#include + class SignalSender : public QObject { Q_OBJECT public: - static SignalSender* getInstance(QObject* parent = 0); + static SignalSender* getInstance(); void closeAll(); signals: diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index 8804d8fd477..4028b10268d 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -1,8 +1,8 @@ #include "SignalSender.h" -static SignalSender* getInstance(QObject* parent = 0) +static SignalSender* getInstance() { - static SignalSender* instance = new SignalSender(parent); + static SignalSender* instance = new SignalSender(); return instance; } From 0a3c23bfd2cecc1da830caf99dea024f9b9a6035 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 18:24:50 +0000 Subject: [PATCH 12/23] build --- src/gui/SignalSender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index 4028b10268d..eff5d4c406e 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -1,12 +1,12 @@ #include "SignalSender.h" -static SignalSender* getInstance() +SignalSender* SignalSender::getInstance() { static SignalSender* instance = new SignalSender(); return instance; } -void closeAll() +void SignalSender::closeAll() { emit closeAllSignal(); } \ No newline at end of file From a0a155573f99cf0ae8b87cbcbb76d68b729d29f7 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 18:30:19 +0000 Subject: [PATCH 13/23] this is actually a slot! --- include/SignalSender.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index 74964ee9287..67850cda7e0 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -9,10 +9,12 @@ class SignalSender : public QObject public: static SignalSender* getInstance(); - void closeAll(); signals: void closeAllSignal(); + +public slots: + void closeAll(); }; #endif \ No newline at end of file From c41bf5359a67923d43298dd60eee65c6e003fd50 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 18:55:34 +0000 Subject: [PATCH 14/23] m_closeAllButThisAction --- include/SignalSender.h | 4 +++- include/SubWindow.h | 3 +++ src/gui/SignalSender.cpp | 7 ++++++- src/gui/SubWindow.cpp | 19 +++++++++++++++++-- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index 67850cda7e0..df37c38e602 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -12,9 +12,11 @@ class SignalSender : public QObject signals: void closeAllSignal(); + void closeAllButThisSignal(); public slots: void closeAll(); + void closeAllButThis(); }; -#endif \ No newline at end of file +#endif diff --git a/include/SubWindow.h b/include/SubWindow.h index accf89e78c1..6980cefe3e9 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -74,6 +74,7 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow signals: void focusLost(); + void closeAllButThisSignal(); private: const QSize m_buttonSize; @@ -91,12 +92,14 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow bool m_hasFocus; QMenu* m_systemMenu; QAction* m_closeAllAction; + QAction* m_closeAllButThisAction; static void elideText( QLabel *label, QString text ); void adjustTitleBar(); private slots: void focusChanged( QMdiSubWindow * subWindow ); + void closeAllButThis(); }; #endif diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index eff5d4c406e..08151a1de0d 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -9,4 +9,9 @@ SignalSender* SignalSender::getInstance() void SignalSender::closeAll() { emit closeAllSignal(); -} \ No newline at end of file +} + +void SignalSender::closeAllButThis() +{ + emit closeAllButThisSignal(); +} diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 7f96fbfd76f..634afdf666a 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -37,6 +37,10 @@ #include "embed.h" #include "SignalSender.h" +void SubWindow::closeAllButThis() +{ + emit closeAllButThisSignal(); +} SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : @@ -99,10 +103,21 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // get the default systemMenu m_systemMenu = systemMenu(); + // create 'close all but this' action + m_closeAllButThisAction = new QAction(); + m_closeAllButThisAction->setText("Close all but this"); + //m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + // connect action to signal + connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis())); + connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal()), this, SLOT(closeAllButThis())); + connect(this, SIGNAL(closeAllButThisSignal()), this, SLOT(close())); + // add action to systemMenu + m_systemMenu->addAction(m_closeAllButThisAction); + // create 'close all' action m_closeAllAction = new QAction(); m_closeAllAction->setText("Close all"); - m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + //m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); // connect action to signal connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); @@ -393,4 +408,4 @@ void SubWindow::resizeEvent( QResizeEvent * event ) { m_trackedNormalGeom.setSize( event->size() ); } -} \ No newline at end of file +} From 6b926c320cbc9d97c1bac09c9cabd8c79606c60a Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 19:12:10 +0000 Subject: [PATCH 15/23] if (source != this) --- include/SignalSender.h | 4 ++-- include/SubWindow.h | 4 ++-- src/gui/SignalSender.cpp | 5 +++-- src/gui/SubWindow.cpp | 12 +++++++----- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index df37c38e602..50ad4b55c59 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -12,11 +12,11 @@ class SignalSender : public QObject signals: void closeAllSignal(); - void closeAllButThisSignal(); + void closeAllButThisSignal(SubWindow * source); public slots: void closeAll(); - void closeAllButThis(); + void closeAllButThis(SubWindow* source); }; #endif diff --git a/include/SubWindow.h b/include/SubWindow.h index 6980cefe3e9..b669404be27 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -74,7 +74,7 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow signals: void focusLost(); - void closeAllButThisSignal(); + void closeSignal(); private: const QSize m_buttonSize; @@ -99,7 +99,7 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow private slots: void focusChanged( QMdiSubWindow * subWindow ); - void closeAllButThis(); + void closeAllButThis( SubWindow * source); }; #endif diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index 08151a1de0d..41797608e8e 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -1,4 +1,5 @@ #include "SignalSender.h" +#include "SubWindow.h" SignalSender* SignalSender::getInstance() { @@ -11,7 +12,7 @@ void SignalSender::closeAll() emit closeAllSignal(); } -void SignalSender::closeAllButThis() +void SignalSender::closeAllButThis(SubWindow* source) { - emit closeAllButThisSignal(); + emit closeAllButThisSignal(source); } diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 634afdf666a..7f2c2365438 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -37,9 +37,11 @@ #include "embed.h" #include "SignalSender.h" -void SubWindow::closeAllButThis() +void SubWindow::closeAllButThis(SubWindow* source) { - emit closeAllButThisSignal(); + if (source != this) { + emit closeSignal(); + } } @@ -108,9 +110,9 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeAllButThisAction->setText("Close all but this"); //m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to signal - connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis())); - connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal()), this, SLOT(closeAllButThis())); - connect(this, SIGNAL(closeAllButThisSignal()), this, SLOT(close())); + connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); + connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThis(SubWindow*))); + connect(this, SIGNAL(closeSignal()), this, SLOT(close())); // add action to systemMenu m_systemMenu->addAction(m_closeAllButThisAction); From c426600222462cd329b80d0b55489f740c1c0dda Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 19:39:34 +0000 Subject: [PATCH 16/23] closeAllButThisEmit --- include/SignalSender.h | 1 + include/SubWindow.h | 3 ++- src/gui/SignalSender.cpp | 4 +--- src/gui/SubWindow.cpp | 13 ++++++++++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index 50ad4b55c59..3ea147a8f4c 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -2,6 +2,7 @@ #define SIGNALSENDER_H #include +#include "SubWindow.h" class SignalSender : public QObject { diff --git a/include/SubWindow.h b/include/SubWindow.h index b669404be27..9632d8e6850 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -99,7 +99,8 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow private slots: void focusChanged( QMdiSubWindow * subWindow ); - void closeAllButThis( SubWindow * source); + void closeAllButThisEmit(); + void closeAllButThisRecive( SubWindow * source); }; #endif diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index 41797608e8e..b64447e6927 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -1,10 +1,8 @@ #include "SignalSender.h" -#include "SubWindow.h" SignalSender* SignalSender::getInstance() { - static SignalSender* instance = new SignalSender(); - return instance; + return new SignalSender(); } void SignalSender::closeAll() diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 7f2c2365438..2d69e17cef9 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -37,7 +37,13 @@ #include "embed.h" #include "SignalSender.h" -void SubWindow::closeAllButThis(SubWindow* source) +void SubWindow::closeAllButThisEmit() +{ + emit SignalSender::getInstance()->closeAllButThis(this); +} + + +void SubWindow::closeAllButThisRecive(SubWindow* source) { if (source != this) { emit closeSignal(); @@ -110,8 +116,9 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeAllButThisAction->setText("Close all but this"); //m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to signal - connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); - connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThis(SubWindow*))); + connect(m_closeAllButThisAction, SIGNAL(triggered()), this, SLOT(closeAllButThisEmit())); + //connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); + connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThisRecive(SubWindow*))); connect(this, SIGNAL(closeSignal()), this, SLOT(close())); // add action to systemMenu m_systemMenu->addAction(m_closeAllButThisAction); From de930c2445f5dd2c5fd0d0879875c5c7741758d4 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 19:47:42 +0000 Subject: [PATCH 17/23] set the setShortcut --- src/gui/SubWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 2d69e17cef9..1470ffc794d 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -114,7 +114,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // create 'close all but this' action m_closeAllButThisAction = new QAction(); m_closeAllButThisAction->setText("Close all but this"); - //m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to signal connect(m_closeAllButThisAction, SIGNAL(triggered()), this, SLOT(closeAllButThisEmit())); //connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); @@ -126,7 +126,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // create 'close all' action m_closeAllAction = new QAction(); m_closeAllAction->setText("Close all"); - //m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); + m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_E)); // connect action to signal connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); From d7ac31c892b7c77c6efcd7670efac80e60d3c26e Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 20:00:05 +0000 Subject: [PATCH 18/23] try undoing this --- src/gui/SignalSender.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index b64447e6927..4f87e815dab 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -2,7 +2,8 @@ SignalSender* SignalSender::getInstance() { - return new SignalSender(); + static SignalSender* instance = new SignalSender(); + return instance; } void SignalSender::closeAll() From ca717d8e37f867d4bb840b9b3f021e0322ea9238 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 20:13:31 +0000 Subject: [PATCH 19/23] add action to subwindow to capture keypress --- src/gui/SubWindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 1470ffc794d..617686e6bf8 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -114,22 +114,26 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // create 'close all but this' action m_closeAllButThisAction = new QAction(); m_closeAllButThisAction->setText("Close all but this"); - m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Q)); // connect action to signal connect(m_closeAllButThisAction, SIGNAL(triggered()), this, SLOT(closeAllButThisEmit())); //connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThisRecive(SubWindow*))); connect(this, SIGNAL(closeSignal()), this, SLOT(close())); + // add action to subwindow to capture keypress + addAction(m_closeAllButThisAction); // add action to systemMenu m_systemMenu->addAction(m_closeAllButThisAction); // create 'close all' action m_closeAllAction = new QAction(); m_closeAllAction->setText("Close all"); - m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_E)); + m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to signal connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); + // add action to subwindow to capture keypress + addAction(m_closeAllAction); // add action to systemMenu m_systemMenu->addAction(m_closeAllAction); From 15b445d564453307446346482ba3f4278a497a30 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 20:57:41 +0000 Subject: [PATCH 20/23] reorder items --- src/gui/SubWindow.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 617686e6bf8..27fda0a1a76 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -111,6 +111,18 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // get the default systemMenu m_systemMenu = systemMenu(); + // create 'close all' action + m_closeAllAction = new QAction(); + m_closeAllAction->setText("Close all"); + m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + // connect action to signal + connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); + connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); + // add action to subwindow to capture keypress + addAction(m_closeAllAction); + // add action to systemMenu + m_systemMenu->addAction(m_closeAllAction); + // create 'close all but this' action m_closeAllButThisAction = new QAction(); m_closeAllButThisAction->setText("Close all but this"); @@ -125,18 +137,6 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // add action to systemMenu m_systemMenu->addAction(m_closeAllButThisAction); - // create 'close all' action - m_closeAllAction = new QAction(); - m_closeAllAction->setText("Close all"); - m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - // connect action to signal - connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); - connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); - // add action to subwindow to capture keypress - addAction(m_closeAllAction); - // add action to systemMenu - m_systemMenu->addAction(m_closeAllAction); - // update systemMenu setSystemMenu(m_systemMenu); } From f4b53f0df5aa2623f5765f29445867206a8abcca Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 31 Jan 2021 10:05:50 +0000 Subject: [PATCH 21/23] comments --- src/gui/SubWindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 27fda0a1a76..9480d1dc6e1 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -39,18 +39,18 @@ void SubWindow::closeAllButThisEmit() { + // trigger signal sender to send a close event to all elements emit SignalSender::getInstance()->closeAllButThis(this); } - void SubWindow::closeAllButThisRecive(SubWindow* source) { + // check if source of signal is equal to the current window if (source != this) { emit closeSignal(); } } - SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : QMdiSubWindow( parent, windowFlags ), m_buttonSize( 17, 17 ), @@ -115,8 +115,9 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeAllAction = new QAction(); m_closeAllAction->setText("Close all"); m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); - // connect action to signal + // connect action to SignalSender connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); + // connect SignalSender to close action connect(SignalSender::getInstance(), SIGNAL(closeAllSignal()), this, SLOT(close())); // add action to subwindow to capture keypress addAction(m_closeAllAction); @@ -127,10 +128,11 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeAllButThisAction = new QAction(); m_closeAllButThisAction->setText("Close all but this"); m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Q)); - // connect action to signal + // connect action to signal emit connect(m_closeAllButThisAction, SIGNAL(triggered()), this, SLOT(closeAllButThisEmit())); - //connect(m_closeAllButThisAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAllButThis(this))); + // connect SignalSender to signal recive connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThisRecive(SubWindow*))); + // connect signal to close action connect(this, SIGNAL(closeSignal()), this, SLOT(close())); // add action to subwindow to capture keypress addAction(m_closeAllButThisAction); From 50e0e52a59e59df0f41960e41dd549b0fbb3ae6f Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 31 Jan 2021 10:23:46 +0000 Subject: [PATCH 22/23] close others --- include/SignalSender.h | 4 ++-- include/SubWindow.h | 6 +++--- src/gui/SignalSender.cpp | 4 ++-- src/gui/SubWindow.cpp | 24 ++++++++++++------------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/SignalSender.h b/include/SignalSender.h index 3ea147a8f4c..e0a93e69474 100644 --- a/include/SignalSender.h +++ b/include/SignalSender.h @@ -13,11 +13,11 @@ class SignalSender : public QObject signals: void closeAllSignal(); - void closeAllButThisSignal(SubWindow * source); + void closeOthersSignal(SubWindow * source); public slots: void closeAll(); - void closeAllButThis(SubWindow* source); + void closeOthers(SubWindow* source); }; #endif diff --git a/include/SubWindow.h b/include/SubWindow.h index 9632d8e6850..0cee0ffba6b 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -92,15 +92,15 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow bool m_hasFocus; QMenu* m_systemMenu; QAction* m_closeAllAction; - QAction* m_closeAllButThisAction; + QAction* m_closeOthersAction; static void elideText( QLabel *label, QString text ); void adjustTitleBar(); private slots: void focusChanged( QMdiSubWindow * subWindow ); - void closeAllButThisEmit(); - void closeAllButThisRecive( SubWindow * source); + void closeOthersEmit(); + void closeOthersRecive( SubWindow * source); }; #endif diff --git a/src/gui/SignalSender.cpp b/src/gui/SignalSender.cpp index 4f87e815dab..792e60f5a50 100644 --- a/src/gui/SignalSender.cpp +++ b/src/gui/SignalSender.cpp @@ -11,7 +11,7 @@ void SignalSender::closeAll() emit closeAllSignal(); } -void SignalSender::closeAllButThis(SubWindow* source) +void SignalSender::closeOthers(SubWindow* source) { - emit closeAllButThisSignal(source); + emit closeOthersSignal(source); } diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 9480d1dc6e1..eedda2926a2 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -37,15 +37,15 @@ #include "embed.h" #include "SignalSender.h" -void SubWindow::closeAllButThisEmit() +void SubWindow::closeOthersEmit() { // trigger signal sender to send a close event to all elements - emit SignalSender::getInstance()->closeAllButThis(this); + emit SignalSender::getInstance()->closeOthers(this); } -void SubWindow::closeAllButThisRecive(SubWindow* source) +void SubWindow::closeOthersRecive(SubWindow* source) { - // check if source of signal is equal to the current window + // make sure source of signal is not the current window if (source != this) { emit closeSignal(); } @@ -124,20 +124,20 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : // add action to systemMenu m_systemMenu->addAction(m_closeAllAction); - // create 'close all but this' action - m_closeAllButThisAction = new QAction(); - m_closeAllButThisAction->setText("Close all but this"); - m_closeAllButThisAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Q)); + // create 'close others' action + m_closeOthersAction = new QAction(); + m_closeOthersAction->setText("Close others"); + m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Q)); // connect action to signal emit - connect(m_closeAllButThisAction, SIGNAL(triggered()), this, SLOT(closeAllButThisEmit())); + connect(m_closeOthersAction, SIGNAL(triggered()), this, SLOT(closeOthersEmit())); // connect SignalSender to signal recive - connect(SignalSender::getInstance(), SIGNAL(closeAllButThisSignal(SubWindow*)), this, SLOT(closeAllButThisRecive(SubWindow*))); + connect(SignalSender::getInstance(), SIGNAL(closeOthersSignal(SubWindow*)), this, SLOT(closeOthersRecive(SubWindow*))); // connect signal to close action connect(this, SIGNAL(closeSignal()), this, SLOT(close())); // add action to subwindow to capture keypress - addAction(m_closeAllButThisAction); + addAction(m_closeOthersAction); // add action to systemMenu - m_systemMenu->addAction(m_closeAllButThisAction); + m_systemMenu->addAction(m_closeOthersAction); // update systemMenu setSystemMenu(m_systemMenu); From 66027746a4878650a0e19e5459b609e11f506de2 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sun, 31 Jan 2021 11:00:59 +0000 Subject: [PATCH 23/23] fix for linux gcc build --- src/gui/SubWindow.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index eedda2926a2..6957d077493 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -112,8 +112,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_systemMenu = systemMenu(); // create 'close all' action - m_closeAllAction = new QAction(); - m_closeAllAction->setText("Close all"); + m_closeAllAction = new QAction("Close all", this); m_closeAllAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); // connect action to SignalSender connect(m_closeAllAction, SIGNAL(triggered()), SignalSender::getInstance(), SLOT(closeAll())); @@ -125,8 +124,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_systemMenu->addAction(m_closeAllAction); // create 'close others' action - m_closeOthersAction = new QAction(); - m_closeOthersAction->setText("Close others"); + m_closeOthersAction = new QAction("Close others", this); m_closeOthersAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Q)); // connect action to signal emit connect(m_closeOthersAction, SIGNAL(triggered()), this, SLOT(closeOthersEmit()));