diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-12-17 12:51:59 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-12-17 12:52:37 +0100 |
commit | bfd7e5409720445b8439de20a5695b220f79f53d (patch) | |
tree | 2b71ff2e3dcfce09884003d2565e0867c1c44bba /src/qt | |
parent | 34241716852df6ea6a3543822f3bf6f886519d4b (diff) | |
parent | 3e21b690d1aedb73a7dc2bc5d2ff1b011b52d927 (diff) |
Merge #14979: [Qt] Restore < Qt5.6 compatibility for addAction
3e21b690d1aedb73a7dc2bc5d2ff1b011b52d927 [Qt] Restore < Qt5.6 compatibility for addAction (Jonas Schnelli)
Pull request description:
#14573 broke < Qt5.6 compatibility due to calling the lambda version of `addAction` that was added in Qt5.6.
This PR re-enables < Qt5.6 compatibility.
Tree-SHA512: b3cf055d88a76713d100be05b2298d4091967e1a43de176af2647f59e76b98b216493dd12a6d68a942ae7946f2026e33dd8e8d20fc44a9a9614a3690ad9a2417
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoingui.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index c281e2bb02..d7056ddd89 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -400,16 +400,18 @@ void BitcoinGUI::createMenuBar() QMenu* window_menu = appMenuBar->addMenu(tr("&Window")); - QAction* minimize_action = window_menu->addAction(tr("Minimize"), [] { + QAction* minimize_action = window_menu->addAction(tr("Minimize")); + minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); + connect(minimize_action, &QAction::triggered, [] { qApp->focusWindow()->showMinimized(); - }, QKeySequence(Qt::CTRL + Qt::Key_M)); - + }); connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) { minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized); }); #ifdef Q_OS_MAC - QAction* zoom_action = window_menu->addAction(tr("Zoom"), [] { + QAction* zoom_action = window_menu->addAction(tr("Zoom")); + connect(zoom_action, &QAction::triggered, [] { QWindow* window = qApp->focusWindow(); if (window->windowState() != Qt::WindowMaximized) { window->showMaximized(); @@ -422,7 +424,8 @@ void BitcoinGUI::createMenuBar() zoom_action->setEnabled(window != nullptr); }); #else - QAction* restore_action = window_menu->addAction(tr("Restore"), [] { + QAction* restore_action = window_menu->addAction(tr("Restore")); + connect(restore_action, &QAction::triggered, [] { qApp->focusWindow()->showNormal(); }); @@ -433,7 +436,8 @@ void BitcoinGUI::createMenuBar() if (walletFrame) { window_menu->addSeparator(); - window_menu->addAction(tr("Main Window"), [this] { + QAction* main_window_action = window_menu->addAction(tr("Main Window")); + connect(main_window_action, &QAction::triggered, [this] { GUIUtil::bringToFront(this); }); @@ -444,7 +448,8 @@ void BitcoinGUI::createMenuBar() window_menu->addSeparator(); for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) { - window_menu->addAction(rpcConsole->tabTitle(tab_type), [this, tab_type] { + QAction* tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type)); + connect(tab_action, &QAction::triggered, [this, tab_type] { rpcConsole->setTabFocus(tab_type); showDebugWindow(); }); |