#include <QMouseEvent>
#include <QApplication>
+#include <QCursor>
//#define DEBUG_DO_NOT_BY_ENTER
+//#define DEBUG_CURSOR
+
/// Returns list of unique objects by sum of objects from List1 and List2
/*QList<ModuleBase_ViewerPrs> getSumList(const QList<ModuleBase_ViewerPrs>& theList1,
const QList<ModuleBase_ViewerPrs>& theList2)
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;
return;
#endif
- if (canChangeCursor(getCurrentOperation()))
+ if (canChangeCursor(getCurrentOperation())) {
QApplication::restoreOverrideCursor();
+#ifdef DEBUG_CURSOR
+ qDebug("onLeaveViewPort() : None");
+#endif
+ }
if (!isNestedCreateOperation(getCurrentOperation()))
return;
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
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()
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)