Skip to content

Commit

Permalink
add action to subwindow to capture keypress
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-giddins committed Jan 30, 2021
1 parent d7ac31c commit ca717d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/SubWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ca717d8

Please sign in to comment.