From 259773f7e202ab6a23b129ac08bab7f3032f42ae Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 30 Sep 2014 17:00:12 +0400 Subject: [PATCH] Bugfix for radius constraint creation --- src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 2 -- src/ModuleBase/ModuleBase_WidgetPoint2D.cpp | 2 -- .../ModuleBase_WidgetShapeSelector.cpp | 3 +-- src/PartSet/PartSet_OperationFeatureCreate.cpp | 17 ++++++++++------- src/XGUI/XGUI_OperationMgr.cpp | 3 --- src/XGUI/XGUI_PropertyPanel.cpp | 1 + 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 6d470dbbd..48620cbdc 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -92,8 +92,6 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, aControlLay->setStretch(1, 1); connect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); - - mySpinBox->installEventFilter(this); } ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp index 8feec7a6c..3271fe723 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp @@ -66,8 +66,6 @@ ModuleBase_WidgetPoint2D::ModuleBase_WidgetPoint2D(QWidget* theParent, connect(myYSpin, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); } - myXSpin->installEventFilter(this); - myYSpin->installEventFilter(this); } ModuleBase_WidgetPoint2D::~ModuleBase_WidgetPoint2D() diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index e0c12b197..fcd287c55 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -72,7 +72,6 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen myTextLine = new QLineEdit(myContainer); myTextLine->setReadOnly(true); myTextLine->setToolTip(aToolTip); - myTextLine->installEventFilter(this); myBasePalet = myTextLine->palette(); myInactivePalet = myBasePalet; @@ -273,4 +272,4 @@ bool ModuleBase_WidgetShapeSelector::eventFilter(QObject* theObj, QEvent* theEve activateSelection(true); } return ModuleBase_ModelWidget::eventFilter(theObj, theEvent); -} \ No newline at end of file +} diff --git a/src/PartSet/PartSet_OperationFeatureCreate.cpp b/src/PartSet/PartSet_OperationFeatureCreate.cpp index 1e7e3468b..b9c2326ee 100644 --- a/src/PartSet/PartSet_OperationFeatureCreate.cpp +++ b/src/PartSet/PartSet_OperationFeatureCreate.cpp @@ -67,8 +67,10 @@ bool PartSet_OperationFeatureCreate::canProcessKind(const std::string& theId) bool PartSet_OperationFeatureCreate::canBeCommitted() const { - if (PartSet_OperationSketchBase::canBeCommitted()) - return !myActiveWidget; + if (PartSet_OperationSketchBase::canBeCommitted()) { + //if(myActiveWidget && !myActiveWidget->isComputedDefault()) { + return isValid(); + } return false; } @@ -145,11 +147,12 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle emit activateNextWidget(myActiveWidget); } - if (commit() && !isClosedContour) { - // if the point creation is finished, the next mouse release should commit the modification - // the next release can happens by double click in the viewer - restartOperation(feature()->getKind(), feature()); - return; + if (myActiveWidget == NULL) { + if(commit() && !isClosedContour) { + // if the point creation is finished, the next mouse release should commit the modification + // the next release can happens by double click in the viewer + restartOperation(feature()->getKind(), feature()); + } } } diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 045598396..88d5f89de 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -228,9 +228,6 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent) break; case Qt::Key_Return: case Qt::Key_Enter: { - if(anOperation) { - anOperation->activateNextToCurrentWidget(); - } commitOperation(); } break; diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 9a5877369..14ae5b6d9 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -131,6 +131,7 @@ void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature) void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget) { + QObject* aSender = sender(); ModuleBase_ModelWidget* aNextWidget = 0; QList::const_iterator anIt = myWidgets.begin(), aLast = myWidgets.end(); bool isFoundWidget = false; -- 2.39.2