From 8a0404c19ec427e4fe9ff7e85df22684b9809f69 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 6 Nov 2014 15:42:05 +0300 Subject: [PATCH] refs #200 - edit Length constraint is outside of the transaction 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 | 9 ++++++++- src/PartSet/PartSet_OperationFeatureEdit.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index cedba1c95..c91e91b85 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -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 aSelected = theSelection->getSelected(); if (!aSelected.empty()) { @@ -383,6 +389,7 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick( } } } + myIsBlockedByDoubleClick = false; } void PartSet_OperationFeatureEdit::startOperation() diff --git a/src/PartSet/PartSet_OperationFeatureEdit.h b/src/PartSet/PartSet_OperationFeatureEdit.h index a4bec4ef7..7f948d5c7 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.h +++ b/src/PartSet/PartSet_OperationFeatureEdit.h @@ -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 -- 2.39.2