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 <[email protected]>

---------

Co-authored-by: Chris Hennes <[email protected]>
Co-authored-by: Benjamin Nauck <[email protected]>
This commit is contained in:
Ian Hunter
2025-02-16 14:36:18 -03:00
committed by Adrian Insaurralde
co-authored by Chris Hennes Benjamin Nauck
parent 12dc5829d7
commit 5f2ac5479b
@@ -1643,6 +1643,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)