From adfe6cfe1e1fb3d580248788d8f1b239ddd41f7f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 20 Oct 2013 20:34:29 +0200 Subject: add kbd shortcut for quitting the software Signed-off-by: Stanislaw Halik --- facetracknoir/facetracknoir.cpp | 6 +++++- facetracknoir/facetracknoir.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'facetracknoir') diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index 1d531229..48bca959 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -102,7 +102,8 @@ FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WindowFlags flags) : pSecondTrackerDialog(NULL), pProtocolDialog(NULL), pFilterDialog(NULL), - looping(false) + looping(false), + kbd_quit(QKeySequence("Ctrl+Q"), this) { ui.setupUi(this); setFixedSize(size()); @@ -171,6 +172,9 @@ FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WindowFlags flags) : connect(&keyCenter, SIGNAL(activated()), this, SLOT(shortcutRecentered())); connect(&keyToggle, SIGNAL(activated()), this, SLOT(shortcutToggled())); #endif + + connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); + kbd_quit.setEnabled(true); } /** destructor stops the engine and quits the faceapi **/ diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/facetracknoir.h index c5b2dc01..491274c8 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/facetracknoir.h @@ -38,6 +38,7 @@ #include #include #include +#include #if !defined(_WIN32) # include "qxt-mini/QxtGlobalShortcut" #else @@ -123,6 +124,7 @@ private: QList dlopen_filters; QList dlopen_trackers; QList dlopen_protocols; + QShortcut kbd_quit; #ifndef _WIN32 void bind_keyboard_shortcut(QxtGlobalShortcut& key, const QString label, QSettings& iniFile); -- cgit v1.2.3