From b068ae6019982d20a17ca3f366a866c2ee24ee4c Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 24 Apr 2014 23:58:58 +0200 Subject: Close user manual window shortcut Add ability to close the user manual window with a Ctrl-W shortcut. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/usermanual.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui/usermanual.cpp') diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp index 58cc82f7f..aff9cc1ed 100644 --- a/qt-ui/usermanual.cpp +++ b/qt-ui/usermanual.cpp @@ -1,4 +1,5 @@ #include +#include #include "usermanual.h" #include "ui_usermanual.h" @@ -10,6 +11,9 @@ UserManual::UserManual(QWidget *parent) : QMainWindow(parent), { ui->setupUi(this); + QShortcut* closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); + connect(closeKey, SIGNAL(activated()), this, SLOT(close())); + QAction *actionShowSearch = new QAction(this); actionShowSearch->setShortcut(Qt::CTRL + Qt::Key_F); actionShowSearch->setShortcutContext(Qt::WindowShortcut); -- cgit v1.2.3-70-g09d2