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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user