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 <benjamin@nauck.se>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
This commit is contained in:
Ian Hunter
2025-02-11 12:03:04 -05:00
committed by GitHub
parent e7c86d7710
commit 67f8852697

View File

@@ -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)