changeset 17:d40345d63733

Implement some keyboard shortcuts.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 30 Mar 2017 18:37:49 +0300
parents 8765397e45f4
children 8282142605e0
files main.cpp main.h
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main.cpp	Thu Mar 30 18:15:09 2017 +0300
+++ b/main.cpp	Thu Mar 30 18:37:49 2017 +0300
@@ -198,6 +198,10 @@
     ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
 
     setActivePerson(-1);
+
+    // Keyboard shortcuts
+    sc_quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(close()));
+    sc_esc = new QShortcut(QKeySequence(Qt::Key_Escape), this, SLOT(on_button_ClearFilter_clicked()));
 }
 
 
--- a/main.h	Thu Mar 30 18:15:09 2017 +0300
+++ b/main.h	Thu Mar 30 18:37:49 2017 +0300
@@ -7,6 +7,7 @@
 #define MAINWINDOW_H
 
 #include <QMainWindow>
+#include <QShortcut>
 #include <QDialog>
 #include <QtSql>
 #include <QSqlQueryModel>
@@ -148,6 +149,8 @@
     int peopleSortIndex;
     Qt::SortOrder peopleSortOrder;
     QString peopleFilter;
+
+    QShortcut *sc_quit, *sc_esc;
 };