SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
rulelistmodel.h File Reference

Slice BR Phase 6.8.1 — list-pane Qt model for control rules. More...

#include <QAbstractListModel>
#include <QPointer>
Include dependency graph for rulelistmodel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmmvis::ui::RuleListModel
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::controls
 
namespace  openswmmvis::ui
 

Detailed Description

Slice BR Phase 6.8.1 — list-pane Qt model for control rules.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

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.
  • removeRowsapplyControlRuleRemove (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.