From 1fa9c3e8d53650ea38419ed87d646ccf0ceb361e Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Mon, 1 May 2017 11:47:00 +0200 Subject: [PATCH] Remove double clicking. It somehow segfaults..... --- cropeditor/cropscene.cpp | 9 ++------- cropeditor/cropscene.hpp | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cropeditor/cropscene.cpp b/cropeditor/cropscene.cpp index e3a4cb9..f0d5060 100644 --- a/cropeditor/cropscene.cpp +++ b/cropeditor/cropscene.cpp @@ -110,11 +110,6 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) prevButtons = Qt::NoButton; } -void CropScene::keyReleaseEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) done(); -} - void CropScene::addDrawingAction(QMenu &menu, DrawItem *item) { QAction *action = new QAction; @@ -141,9 +136,9 @@ void CropScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *e) e->accept(); } -void CropScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) +void CropScene::keyReleaseEvent(QKeyEvent *event) { - done(); + if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) done(); // Segfault } void CropScene::done() diff --git a/cropeditor/cropscene.hpp b/cropeditor/cropscene.hpp index 0284b15..ded499e 100644 --- a/cropeditor/cropscene.hpp +++ b/cropeditor/cropscene.hpp @@ -30,7 +30,6 @@ class CropScene : public QGraphicsScene protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *e) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *e) override; - void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) override; void contextMenuEvent(QGraphicsSceneContextMenuEvent *e) override; void keyReleaseEvent(QKeyEvent *e) override;