From 75a4acaea7e1c46af8c7578ecb831a4fd06cfd6e Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Wed, 2 Dec 2015 21:33:42 +0200 Subject: [PATCH] Resolved Issue #272. Show that user can move workpiece. --HG-- branch : feature --- src/libs/vtools/tools/vtooldetail.cpp | 16 ++++++++++++++++ src/libs/vtools/tools/vtooldetail.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index 07936d6da..63d7fc44f 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -113,6 +113,7 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32 qApp->getUndoStack()->endMacro(); } } + setAcceptHoverEvents(true); } //--------------------------------------------------------------------------------------------------------------------- @@ -405,6 +406,21 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QGraphicsItem::mouseReleaseEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolDetail::hoverEnterEvent(QGraphicsSceneHoverEvent *event) +{ + Q_UNUSED(event); + QApplication::setOverrideCursor(QCursor(cursorArrowOpenHand, 1, 1)); +} + +////--------------------------------------------------------------------------------------------------------------------- +void VToolDetail::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) +{ + Q_UNUSED(event); + //Disable cursor-arrow-openhand + QApplication::restoreOverrideCursor(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. diff --git a/src/libs/vtools/tools/vtooldetail.h b/src/libs/vtools/tools/vtooldetail.h index 6491b0fb5..3c84648f5 100644 --- a/src/libs/vtools/tools/vtooldetail.h +++ b/src/libs/vtools/tools/vtooldetail.h @@ -94,10 +94,13 @@ protected: virtual void RefreshDataInFile() Q_DECL_OVERRIDE; virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE; virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE; + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE; + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE; virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE; virtual void RemoveReferens() Q_DECL_OVERRIDE; virtual void keyReleaseEvent(QKeyEvent * event) Q_DECL_OVERRIDE; virtual void SetVisualization() Q_DECL_OVERRIDE {} + private: Q_DISABLE_COPY(VToolDetail) /** @brief dialog dialog options. */