From: nds Date: Wed, 28 Jan 2015 07:08:16 +0000 (+0300) Subject: Issue #265 Conflicting constraints after aborting of constraint creation X-Git-Tag: V_1.0.0~17^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5c2aa4b56b3e9617406b25ce33943437a7dd0e55;p=modules%2Fshaper.git Issue #265 Conflicting constraints after aborting of constraint creation --- 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))