diff --git a/ApplicationCode/Commands/RicVec3dPickEventHandler.cpp b/ApplicationCode/Commands/RicVec3dPickEventHandler.cpp index e32b34b9f4..5b397e02dc 100644 --- a/ApplicationCode/Commands/RicVec3dPickEventHandler.cpp +++ b/ApplicationCode/Commands/RicVec3dPickEventHandler.cpp @@ -17,6 +17,7 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RicVec3dPickEventHandler.h" +#include "RiaApplication.h" #include "Rim3dView.h" #include "cafDisplayCoordTransform.h" @@ -52,9 +53,19 @@ bool RicVec3dPickEventHandler::handle3dPickEvent(const Ric3dPickEvent& eventObje return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicVec3dPickEventHandler::registerAsPickEventHandler() +{ + Ric3dViewPickEventHandler::registerAsPickEventHandler(); + RiaApplication::instance()->setOverrideCursor(Qt::CrossCursor); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicVec3dPickEventHandler::notifyUnregistered() { + RiaApplication::instance()->restoreOverrideCursor(); } diff --git a/ApplicationCode/Commands/RicVec3dPickEventHandler.h b/ApplicationCode/Commands/RicVec3dPickEventHandler.h index f71eeaacd3..9b9108bcdf 100644 --- a/ApplicationCode/Commands/RicVec3dPickEventHandler.h +++ b/ApplicationCode/Commands/RicVec3dPickEventHandler.h @@ -31,6 +31,9 @@ class RicVec3dPickEventHandler : public Ric3dViewPickEventHandler public: RicVec3dPickEventHandler(const caf::PdmObjectHandle* handlingObject, caf::PdmField* vectorField); bool handle3dPickEvent(const Ric3dPickEvent& eventObject) override; + + + void registerAsPickEventHandler() override; void notifyUnregistered() override; private: diff --git a/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.cpp b/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.cpp index e664e8e468..e3dab9117b 100644 --- a/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.cpp +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.cpp @@ -88,6 +88,17 @@ QWidget* PdmUiVec3dEditor::createLabelWidget(QWidget* parent) } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmUiVec3dEditor::~PdmUiVec3dEditor() +{ + if (pickEventHandler()) + { + pickEventHandler()->unregisterAsPickEventHandler(); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.h b/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.h index c8c919d3de..3ff2b320d3 100644 --- a/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.h +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmUiVec3dEditor.h @@ -73,7 +73,7 @@ class PdmUiVec3dEditor : public PdmUiFieldEditorHandle public: PdmUiVec3dEditor() {} - ~PdmUiVec3dEditor() override {} + ~PdmUiVec3dEditor() override; protected: QWidget* createEditorWidget(QWidget* parent) override;