![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Slice BR Phase 6.8.1 — list-pane Qt model for control rules. More...
#include <QAbstractListModel>#include <QPointer>Go to the source code of this file.
Classes | |
| class | openswmmvis::ui::RuleListModel |
Namespaces | |
| namespace | openswmmvis |
| namespace | openswmmvis::controls |
| namespace | openswmmvis::ui |
Slice BR Phase 6.8.1 — list-pane Qt model for control rules.
QAbstractListModel over ControlRuleRegistry. One row per provider. Roles:
Qt::DisplayRole → provider name (or Rule N [unnamed] sentinel when the engine returned BADPARAM from swmm_control_get_id).Qt::EditRole → provider name (inline-rename via QListView::edit / F2).Qt::DecorationRole → one of three icon resources (:/swmmvis/RuleValid, :/swmmvis/RuleInvalid, :/swmmvis/RulePending).Qt::ToolTipRole → empty when Valid; otherwise the validator's cached error message.Mutations route through SWMMModelLayer::applyControlRule*:
setData(EditRole) → applyControlRuleRename.removeRows → applyControlRuleRemove (single row at a time; multi-select delete is out of scope).insertRows is not implemented — creation happens via the dialog's create-card (applyControlRuleAdd), and the row arrives via the registry's providerAdded signal.The model is engine-backed (mirrors the engine via the registry) but the dialog can wrap it in a QSortFilterProxyModel for the search-box filtering called for in the plan. The proxy is the dialog's concern; this header stays clean.