From 67f8852697d72569027a480389a64bc03e507697 Mon Sep 17 00:00:00 2001 From: Ian Hunter Date: Tue, 11 Feb 2025 12:03:04 -0500 Subject: [PATCH] Fix bug preventing filtering named constraints (#19339) * Fix bug preventing filtering named constraints There was a bug (see issue #11843) that displayed a filter for Named constraints in the Sketcher Workbench whose toggling did not affect the UI in any way. This enables this feature by checking if a given constraint has a custom name or not and then appropriately toggling its visibility. * Use `std::string::empty()` per reviewer suggestion Co-authored-by: Benjamin Nauck --------- Co-authored-by: Chris Hennes Co-authored-by: Benjamin Nauck --- src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp index af4087c6cb..d750d3b344 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp @@ -1649,6 +1649,8 @@ bool TaskSketcherConstraints::isConstraintFiltered(QListWidgetItem* item) break; } + visible |= !constraint->Name.empty() && checkFilterBitset(multiFilterStatus, FilterValue::Named); + // Then we re-filter based on selected/associated if such mode selected. if (visible && specialFilterMode == SpecialFilterType::Selected) { visible = (std::find(selectionFilter.begin(), selectionFilter.end(), it->ConstraintNbr)