From 8863c8d574bcc336bd397301b65de4841f3505cf Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 7 Nov 2019 17:18:41 +0300 Subject: [PATCH] 5.2.2 Drawing in the sketcher: change the mouse cursor arrow --- src/PartSet/PartSet_Module.cpp | 8 ++-- src/PartSet/PartSet_SketcherMgr.cpp | 58 +++++++++++++++-------------- src/PartSet/PartSet_SketcherMgr.h | 2 +- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index fa801f6aa..59d1b14da 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -434,9 +434,11 @@ void PartSet_Module::updateSketcherOnStart(ModuleBase_Operation* theOperation) if (PartSet_SketcherMgr::isSketchOperation(theOperation)) { mySketchMgr->startSketch(theOperation); } - else if (sketchMgr()->isNestedSketchOperation(theOperation)) { - mySketchMgr->startNestedSketch(theOperation); - } + // It is switched off because of + // Task #3067: 5.2.2 Drawing in the sketcher: change the mouse cursor arrow + //else if (sketchMgr()->isNestedSketchOperation(theOperation)) { + // mySketchMgr->startNestedSketch(theOperation); + //} } //****************************************************** diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 1c88fc4f6..8d8ec531f 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -220,15 +220,17 @@ void PartSet_SketcherMgr::onEnterViewPort() return; #endif - if (canChangeCursor(getCurrentOperation())) { - QCursor* aCurrentCursor = QApplication::overrideCursor(); - if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) { - QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); -#ifdef DEBUG_CURSOR - qDebug("onEnterViewPort() : Qt::CrossCursor"); -#endif - } - } + // It is switched off because of + // Task #3067: 5.2.2 Drawing in the sketcher: change the mouse cursor arrow + // if (canChangeCursor(getCurrentOperation())) { + // QCursor* aCurrentCursor = QApplication::overrideCursor(); + // if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) { + // QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); + //#ifdef DEBUG_CURSOR + // qDebug("onEnterViewPort() : Qt::CrossCursor"); + //#endif + // } + // } if (!isNestedCreateOperation(getCurrentOperation(), activeSketch())) return; @@ -260,12 +262,12 @@ void PartSet_SketcherMgr::onLeaveViewPort() return; #endif - if (canChangeCursor(getCurrentOperation())) { - QApplication::restoreOverrideCursor(); -#ifdef DEBUG_CURSOR - qDebug("onLeaveViewPort() : None"); -#endif - } +// if (canChangeCursor(getCurrentOperation())) { +// QApplication::restoreOverrideCursor(); +//#ifdef DEBUG_CURSOR +// qDebug("onLeaveViewPort() : None"); +//#endif +// } if (!isNestedCreateOperation(getCurrentOperation(), activeSketch())) return; @@ -1184,18 +1186,18 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation) workshop()->viewer()->set2dMode(false); } -void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation) -{ - if (canChangeCursor(theOperation) && myIsMouseOverWindow) { - QCursor* aCurrentCursor = QApplication::overrideCursor(); - if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) { - QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); -#ifdef DEBUG_CURSOR - qDebug("startNestedSketch() : Qt::CrossCursor"); -#endif - } - } -} +//void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation) +//{ +// if (canChangeCursor(theOperation) && myIsMouseOverWindow) { +// QCursor* aCurrentCursor = QApplication::overrideCursor(); +// if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) { +// QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); +//#ifdef DEBUG_CURSOR +// qDebug("startNestedSketch() : Qt::CrossCursor"); +//#endif +// } +// } +//} void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOperation) { @@ -1203,7 +1205,7 @@ void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOperation) operationMgr()->onValidateOperation(); // when sketch nested operation is stopped the cursor should be restored unconditionally //if (canChangeCursor(theOperation)) { - QApplication::restoreOverrideCursor(); + //QApplication::restoreOverrideCursor(); #ifdef DEBUG_CURSOR qDebug("stopNestedSketch() : None"); #endif diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 7259514a4..678baaa3f 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -217,7 +217,7 @@ public: /// Starts sketch operation, connects to the opeation property panel /// \param theOperation a committed operation - void startNestedSketch(ModuleBase_Operation* theOperation); + //void startNestedSketch(ModuleBase_Operation* theOperation); /// Stop sketch operation, disconnects from the opeation property panel /// \param theOperation a stopped operation -- 2.39.2