From d7fbaede7920b839ef5a5f924f9138738e8065f6 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 20 Jun 2017 12:53:13 +0200 Subject: [PATCH] src: Fixed crash when using shortcuts with focus on the graph (issue #390) bug id = 390 --- src/lib_gui/qt/graphics/QtGraphicsView.cpp | 2 +- src/lib_gui/qt/window/QtMainWindow.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_gui/qt/graphics/QtGraphicsView.cpp b/src/lib_gui/qt/graphics/QtGraphicsView.cpp index 6ec88a62..a1ac679c 100644 --- a/src/lib_gui/qt/graphics/QtGraphicsView.cpp +++ b/src/lib_gui/qt/graphics/QtGraphicsView.cpp @@ -195,7 +195,7 @@ void QtGraphicsView::mouseReleaseEvent(QMouseEvent *event) void QtGraphicsView::keyPressEvent(QKeyEvent* event) { - if (event->key() >= Qt::Key_A && event->key() <= Qt::Key_Z) + if (event->key() >= Qt::Key_A && event->key() <= Qt::Key_Z && event->text().size()) { QChar c = event->text().at(0).toUpper(); emit characterKeyPressed(c); diff --git a/src/lib_gui/qt/window/QtMainWindow.h b/src/lib_gui/qt/window/QtMainWindow.h index 694e0bc7..9b615f2b 100644 --- a/src/lib_gui/qt/window/QtMainWindow.h +++ b/src/lib_gui/qt/window/QtMainWindow.h @@ -78,7 +78,7 @@ protected: void keyPressEvent(QKeyEvent* event); void contextMenuEvent(QContextMenuEvent* event); void closeEvent(QCloseEvent* event); - void resizeEvent(QResizeEvent* event) override; + void resizeEvent(QResizeEvent* event); public slots: void about();