From 5c2aa4b56b3e9617406b25ce33943437a7dd0e55 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 28 Jan 2015 10:08:16 +0300 Subject: [PATCH] Issue #265 Conflicting constraints after aborting of constraint creation --- src/ModuleBase/ModuleBase_WidgetShapeSelector.h | 3 +++ src/PartSet/PartSet_SketcherMgr.cpp | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index 755714ffd..f2dbb05c7 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -75,6 +75,9 @@ Q_OBJECT virtual bool restoreValue(); + /// Defines if it is supposed that the widget should interact with the viewer. + virtual bool isViewerSelector() { return true; } + /// Returns the internal parent wiget control, that can be shown anywhere /// \returns the widget QWidget* getControl() const diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index bd8b15dd3..06fcc3371 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -141,11 +141,20 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE if (!(theEvent->buttons() & Qt::LeftButton)) return; + ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); + ModuleBase_Operation* aOperation = aWorkshop->currentOperation(); + if (aOperation && aOperation->isEditOperation()) { + ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel(); + ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget(); + // If the current widget is a selector, do do nothing, it processes the mouse press + if(aActiveWgt && aActiveWgt->isViewerSelector()) { + return; + } + } + // Clear dragging mode myIsDragging = false; - ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); - ModuleBase_Operation* aOperation = aWorkshop->currentOperation(); // Use only for sketch operations if (aOperation && myCurrentSketch) { if (!PartSet_Tools::sketchPlane(myCurrentSketch)) -- 2.39.2