diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-calculator/mainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-calculator/mainUI.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp index 6ba7450b..a0b1416e 100644 --- a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp @@ -55,6 +55,12 @@ mainUI::mainUI() : QMainWindow(), ui(new Ui::mainUI()){ updateMenus(); ui->line_eq->setFocus(); ui->line_eq->setValidator(new EqValidator(this) ); + + // shortcuts + escShortcut = new QShortcut(Qt::Key_Escape, this); + connect(escShortcut, SIGNAL(activated()), this, SLOT(clear_calc()) ); + quitShortcut = new QShortcut(Qt::CTRL + Qt::Key_Q, this); + connect(quitShortcut, SIGNAL(activated()), this, SLOT(on_quitShortcut_Triggered()) ); } mainUI::~mainUI(){ @@ -337,3 +343,8 @@ QString mainUI::getHistory(int number){ return ("("+eq+")"); } } + +void mainUI::on_quitShortcut_Triggered(){ + QApplication::quit(); +} + |