Close user manual window shortcut

Add ability to close the user manual window with a Ctrl-W shortcut.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2014-04-24 23:58:58 +02:00 committed by Dirk Hohndel
parent 0aa8b7f47d
commit b068ae6019

View file

@ -1,4 +1,5 @@
#include <QDesktopServices>
#include <QShortcut>
#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);