]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #200 - edit Length constraint is outside of the transaction
authornds <natalia.donis@opencascade.com>
Thu, 6 Nov 2014 12:42:05 +0000 (15:42 +0300)
committernds <natalia.donis@opencascade.com>
Thu, 6 Nov 2014 12:42:05 +0000 (15:42 +0300)
this bug is reproduced only on Linux. There should be a blocking on the release before double click is processed.

src/PartSet/PartSet_OperationFeatureEdit.cpp
src/PartSet/PartSet_OperationFeatureEdit.h

index cedba1c9551be28147a4390da5470b9ce2c5eafb..c91e91b851ca127bea8839c108982e73ed4f3148 100644 (file)
@@ -46,7 +46,7 @@ PartSet_OperationFeatureEdit::PartSet_OperationFeatureEdit(const QString& theId,
                                                            QObject* theParent,
                                                            CompositeFeaturePtr theFeature)
     : PartSet_OperationFeatureBase(theId, theParent, theFeature),
-      myIsBlockedSelection(false)
+      myIsBlockedSelection(false), myIsBlockedByDoubleClick(false)
 {
   myIsEditing = true;
 }
@@ -320,6 +320,11 @@ void PartSet_OperationFeatureEdit::mouseReleased(
     QMouseEvent* theEvent, ModuleBase_IViewer* theViewer,
     ModuleBase_ISelection* theSelection)
 {
+  // the block is processed in order to do not commit the transaction until the started
+  // double click functionality is performed. It is reproduced on Linux only
+  if (myIsBlockedByDoubleClick)
+    return;
+
   theViewer->enableSelection(true);
   // the next code is commented because it is obsolete by the multi edit operation realization here
   //if (myIsMultiOperation) {
@@ -365,6 +370,7 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick(
     QMouseEvent* theEvent, Handle_V3d_View theView,
     ModuleBase_ISelection* theSelection)
 {
+  myIsBlockedByDoubleClick = true;
   // TODO the functionality is important only for constraint feature. Should be moved in another place
   QList<ModuleBase_ViewerPrs> aSelected = theSelection->getSelected();
   if (!aSelected.empty()) {
@@ -383,6 +389,7 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick(
       }
     }
   }
+  myIsBlockedByDoubleClick  = false;
 }
 
 void PartSet_OperationFeatureEdit::startOperation()
index a4bec4ef755da085c964743590ad3dc2dba96122..7f948d5c7a1ed62126a1457c0f80132e4cdf76cb 100644 (file)
@@ -143,6 +143,8 @@ Q_OBJECT
 
   Point myCurPoint;  ///< the current 3D point clicked or moved
   bool myIsBlockedSelection;  ///< the state of the last state of selection blocked signal
+  bool myIsBlockedByDoubleClick;  ///< the block value by double click is processed to avoid
+  ///< the mouse button release processing before the double click is finished
 };
 
 #endif