From ae4bab9d07b6f82f6f1031873a1b142d4c7f9425 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 29 Aug 2014 17:10:47 +0300 Subject: [PATCH] Don't set cursor "arrow close hand" after double mouse click. --HG-- branch : feature --- src/app/tools/drawTools/vtoolsinglepoint.cpp | 4 ++-- src/app/visualization/vcontrolpointspline.cpp | 4 ++-- src/app/visualization/vgraphicssimpletextitem.cpp | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 36af6b6af..83e23ed44 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -263,7 +263,7 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { #ifndef QT_NO_CURSOR QPixmap pixmap(QLatin1String("://cursor/cursor-arrow-closehand.png")); @@ -276,7 +276,7 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand #ifndef QT_NO_CURSOR diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index ba1644310..70b73bda3 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -127,7 +127,7 @@ QVariant VControlPointSpline::itemChange(QGraphicsItem::GraphicsItemChange chang //--------------------------------------------------------------------------------------------------------------------- void VControlPointSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { #ifndef QT_NO_CURSOR QPixmap pixmap(QLatin1String("://cursor/cursor-arrow-closehand.png")); @@ -140,7 +140,7 @@ void VControlPointSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand #ifndef QT_NO_CURSOR diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index 9de68966f..825362721 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -31,6 +31,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- /** @@ -141,7 +142,7 @@ void VGraphicsSimpleTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *e //--------------------------------------------------------------------------------------------------------------------- void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { #ifndef QT_NO_CURSOR QPixmap pixmap(QLatin1String("://cursor/cursor-arrow-closehand.png")); @@ -154,7 +155,7 @@ void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VGraphicsSimpleTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand #ifndef QT_NO_CURSOR