#include <swmmattributetablemodel.h>
◆ SWMMAttributeTableModel()
| SWMMAttributeTableModel::SWMMAttributeTableModel |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ category()
◆ columnCount()
| int SWMMAttributeTableModel::columnCount |
( |
const QModelIndex & |
parent = {} | ) |
const |
|
override |
◆ columnKeys()
| QStringList SWMMAttributeTableModel::columnKeys |
( |
| ) |
const |
|
inline |
Column-zero header is always "Name"; column 0 returns the object's name unmodified. The remaining columns map to keys from the layer's identify map; column count is fixed per category.
◆ columnSpecs()
Slice Z.5.2 — column metadata (delegate kind, setter, range). Returns the full spec list for the bound category so callers (e.g. AttributeTablePanel) can install delegates.
◆ commitValueDirect()
| bool SWMMAttributeTableModel::commitValueDirect |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value |
|
) |
| |
Direct-commit setter — bypasses the undo stack. Used by EditCommand::redo / undo so re-applying a command doesn't push another command.
◆ data()
| QVariant SWMMAttributeTableModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
override |
◆ flags()
| Qt::ItemFlags SWMMAttributeTableModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
override |
◆ headerData()
| QVariant SWMMAttributeTableModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
override |
◆ layer()
◆ objectEdited
| void SWMMAttributeTableModel::objectEdited |
( |
const QString & |
name | ) |
|
|
signal |
Emitted after a successful direct-edit commit (Attribute Table cell editor → engine setter). Listeners (e.g. the Property Browser dock) use this to refresh their view of the same object. Distinct from QAbstractItemModel:: dataChanged because it fires only on user-initiated edits, not on synthetic refreshes — preventing feedback loops.
◆ objectNameAt()
| QString SWMMAttributeTableModel::objectNameAt |
( |
int |
row | ) |
const |
Object name for a row, or empty string if out of range.
◆ refreshHeaders()
| void SWMMAttributeTableModel::refreshHeaders |
( |
| ) |
|
Re-query every horizontal header. Call after a change that alters a render-time label without touching the schema (LINK_OFFSETS mode → offset columns read "… Elevation").
◆ refreshObject
| void SWMMAttributeTableModel::refreshObject |
( |
const QString & |
name | ) |
|
|
slot |
Round-4 follow-up 2026-05-12 — refresh a single row by object name. Invalidates the row cache so the next data() read re-queries the engine, and emits dataChanged across the row so the view repaints. Used by the panel to mirror property- browser edits without doing a full reset.
◆ reload
| void SWMMAttributeTableModel::reload |
( |
| ) |
|
|
slot |
Force a full reload (e.g. after the underlying SoA changed).
◆ resultsSource()
◆ rowCount()
| int SWMMAttributeTableModel::rowCount |
( |
const QModelIndex & |
parent = {} | ) |
const |
|
override |
◆ rowForName()
| int SWMMAttributeTableModel::rowForName |
( |
const QString & |
name | ) |
const |
Inverse — find the model row for a given object name in the current category. Returns -1 if not found.
◆ setData()
| bool SWMMAttributeTableModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
override |
◆ setResultsSource()
Bind the post-run "dynamics" columns to a loaded output.
Those columns used to read the EDITING engine's ambient statistics (swmm_node_get_stat_* and friends). Nothing ever populates them: SimulationRunner runs on its own throw-away SWMM_Engine (or an out-of-process worker), so the editing engine never reaches the ENDED state the stat getters need and every dynamics cell read back zero. Pointing the model at the active results layer instead makes the columns show the run the user actually selected, and re-pointing it swaps every dynamics value to the new run.
Pass nullptr to fall back to the editing engine.
◆ setSource()
Bind the model to a (layer, category) pair. Rebuilds the column schema, then beginResetModel / endResetModel. Pass a null layer to clear.
◆ setUndoStack()
| void SWMMAttributeTableModel::setUndoStack |
( |
QUndoStack * |
stack | ) |
|
|
inline |
Slice Z.5.5 — optional QUndoStack for cell-edit commands. When set, setData() wraps each commit in an EditCommand pushed onto this stack so Ctrl+Z / Ctrl+Y round-trip. Pass nullptr to disable undo (edits commit immediately).
◆ undoStack()
| QUndoStack * SWMMAttributeTableModel::undoStack |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: