]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #265 Conflicting constraints after aborting of constraint creation
authornds <natalia.donis@opencascade.com>
Wed, 28 Jan 2015 07:08:16 +0000 (10:08 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 28 Jan 2015 07:08:16 +0000 (10:08 +0300)
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/PartSet/PartSet_SketcherMgr.cpp

index 755714ffdfdd04fcc509a5bc8914eba30a00d8e6..f2dbb05c7e95b5ae19312538f39b26ec3633f2ef 100644 (file)
@@ -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
index bd8b15dd374cf64f4a89baa5f06a3df0c1edfb83..06fcc33712e6d31008c3e7b463d68acd00013550 100644 (file)
@@ -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))