From 1ad7724d503c6e85636f5e64127ca6d6c78e094f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 31 Dec 2017 01:57:44 +0100 Subject: [PATCH] avoid error 'Duplicate constraint not allowed' when deleting a constraint --- src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp index 41a5022004..4296a3ee34 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp @@ -782,8 +782,15 @@ void TaskSketcherConstrains::slotConstraintsChanged(void) break; } + // block signals as there is no need to invoke the + // on_listWidgetConstraints_itemChanged() slot in + // case a name has changed because this function gets + // called after changing the constraint list property + QAbstractItemModel* model = ui->listWidgetConstraints->model(); + bool block = model->blockSignals(true); it->setHidden(!visible); it->setData(Qt::EditRole, Base::Tools::fromStdString(constraint->Name)); + model->blockSignals(block); } }