X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_SketcherMgr.cpp;h=eddf4b07eb0afb9e2f5d3048ec5bdc18b566b272;hb=0d9a107853208317a6352bb7f8c77eb54d5efbe1;hp=dcdd6ecc6f52b0e915efe5fdd4f0fefa00f31c63;hpb=d98c9ab081eb1d1c4e8865584d51fce6b6293a06;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index dcdd6ecc6..eddf4b07e 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -75,9 +75,12 @@ #include #include +#include //#define DEBUG_DO_NOT_BY_ENTER +//#define DEBUG_CURSOR + /// Returns list of unique objects by sum of objects from List1 and List2 /*QList getSumList(const QList& theList1, const QList& theList2) @@ -197,8 +200,15 @@ void PartSet_SketcherMgr::onEnterViewPort() return; #endif - if (canChangeCursor(getCurrentOperation())) - QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); + 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())) return; @@ -233,8 +243,12 @@ void PartSet_SketcherMgr::onLeaveViewPort() return; #endif - if (canChangeCursor(getCurrentOperation())) + if (canChangeCursor(getCurrentOperation())) { QApplication::restoreOverrideCursor(); +#ifdef DEBUG_CURSOR + qDebug("onLeaveViewPort() : None"); +#endif + } if (!isNestedCreateOperation(getCurrentOperation())) return; @@ -256,7 +270,6 @@ void PartSet_SketcherMgr::onLeaveViewPort() ModuleBase_ModelWidget* anActiveWidget = getActiveWidget(); if (anActiveWidget) anActiveWidget->reset(); - aDisplayer->enableUpdateViewer(isEnableUpdateViewer); // hides the presentation of the current operation feature // the feature is to be erased here, but it is correct to call canDisplayObject because @@ -267,6 +280,9 @@ void PartSet_SketcherMgr::onLeaveViewPort() FeaturePtr aFeature = aFOperation->feature(); visualizeFeature(aFeature, aFOperation->isEditOperation(), canDisplayObject(aFeature)); } + // we should update viewer after the presentation are hidden in the viewer + // otherwise the reset presentation(line) appears in the viewer(by quick move from viewer to PP) + aDisplayer->enableUpdateViewer(isEnableUpdateViewer); } void PartSet_SketcherMgr::onBeforeValuesChangedInPropertyPanel() @@ -914,16 +930,27 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation) void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation) { - if (canChangeCursor(theOperation) && myIsMouseOverWindow) - QApplication::setOverrideCursor(QCursor(Qt::CrossCursor)); + 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) { myIsMouseOverViewProcessed = true; operationMgr()->onValidateOperation(); - if (canChangeCursor(theOperation)) + if (canChangeCursor(theOperation)) { QApplication::restoreOverrideCursor(); +#ifdef DEBUG_CURSOR + qDebug("stopNestedSketch() : None"); +#endif + } } void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)