From ca717d8e37f867d4bb840b9b3f021e0322ea9238 Mon Sep 17 00:00:00 2001 From: Dan Giddins Date: Sat, 30 Jan 2021 20:13:31 +0000 Subject: [PATCH] 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);