#4047 Alter mouse cursor in Vec3dPickEventHandler

This commit is contained in:
Gaute Lindkvist 2019-02-07 16:34:23 +01:00
parent d20c0fc004
commit 4e17b5acfa
4 changed files with 26 additions and 1 deletions

View File

@ -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();
}

View File

@ -31,6 +31,9 @@ class RicVec3dPickEventHandler : public Ric3dViewPickEventHandler
public:
RicVec3dPickEventHandler(const caf::PdmObjectHandle* handlingObject, caf::PdmField<cvf::Vec3d>* vectorField);
bool handle3dPickEvent(const Ric3dPickEvent& eventObject) override;
void registerAsPickEventHandler() override;
void notifyUnregistered() override;
private:

View File

@ -88,6 +88,17 @@ QWidget* PdmUiVec3dEditor::createLabelWidget(QWidget* parent)
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmUiVec3dEditor::~PdmUiVec3dEditor()
{
if (pickEventHandler())
{
pickEventHandler()->unregisterAsPickEventHandler();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -73,7 +73,7 @@ class PdmUiVec3dEditor : public PdmUiFieldEditorHandle
public:
PdmUiVec3dEditor() {}
~PdmUiVec3dEditor() override {}
~PdmUiVec3dEditor() override;
protected:
QWidget* createEditorWidget(QWidget* parent) override;