From 09507ec2c95fed8ed8918dc3f0fe4be179f5bf59 Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Tue, 25 Jul 2017 17:26:57 +0200 Subject: [PATCH] Some fixes for movin the bar --- cropeditor/cropscene.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cropeditor/cropscene.cpp b/cropeditor/cropscene.cpp index 2ae0d4e..73ed969 100644 --- a/cropeditor/cropscene.cpp +++ b/cropeditor/cropscene.cpp @@ -139,6 +139,7 @@ CropScene::CropScene(QObject *parent, QPixmap pixmap) addItem(polyItem); auto widget = addWidget(menu); + widget->setFlag(QGraphicsItem::ItemIsMovable, true); widget->setZValue(100); widget->setPos(100, 100); proxyMenu = widget; @@ -293,7 +294,7 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { done(true); prevButtons = Qt::NoButton; - QGraphicsScene::mouseReleaseEvent(e); + if (!(e->modifiers() & Qt::ControlModifier)) QGraphicsScene::mouseReleaseEvent(e); } void CropScene::mousePressEvent(QGraphicsSceneMouseEvent *e) { @@ -302,7 +303,7 @@ void CropScene::mousePressEvent(QGraphicsSceneMouseEvent *e) { if (item && item != proxyMenu) removeItem(item); } - QGraphicsScene::mousePressEvent(e); + if (!(e->modifiers() & Qt::ControlModifier)) QGraphicsScene::mousePressEvent(e); } void CropScene::wheelEvent(QGraphicsSceneWheelEvent *event) { @@ -322,7 +323,7 @@ void CropScene::wheelEvent(QGraphicsSceneWheelEvent *event) { initMagnifierGrid(); updateMag(); - QGraphicsScene::wheelEvent(event); + if (!(event->modifiers() & Qt::ControlModifier)) QGraphicsScene::wheelEvent(event); } void CropScene::addDrawingAction(QMenuBar *menu, QString name, QString icon, std::function item) { @@ -341,7 +342,7 @@ void CropScene::keyReleaseEvent(QKeyEvent *event) { settings::settings().setValue("crophint", enabled); } - QGraphicsScene::keyReleaseEvent(event); + if (!(event->modifiers() & Qt::ControlModifier)) QGraphicsScene::keyReleaseEvent(event); } void CropScene::updateMag() {