#include <swmmobjecttreemodel.h>
|
| | SWMMObjectTreeModel (QObject *parent=nullptr) |
| |
| | ~SWMMObjectTreeModel () override |
| |
| void | setLayer (SWMMModelLayer *layer) |
| |
| SWMMModelLayer::Category | categoryAtTopRow (int topRow) const |
| |
| int | topRowForCategory (SWMMModelLayer::Category c) const |
| |
| QModelIndex | indexFor (SWMMModelLayer::Category c, int row) const |
| |
| QModelIndex | indexFor (const SWMMObjectRef &ref) const |
| |
| Section | sectionAtTopRow (int topRow) const |
| |
| SWMMModelLayer::DataCategory | dataCategoryAtTopRow (int topRow) const |
| |
| int | topRowForDataCategory (SWMMModelLayer::DataCategory c) const |
| |
| QModelIndex | index (int row, int column, const QModelIndex &parent={}) const override |
| |
| QModelIndex | parent (const QModelIndex &child) const override |
| |
| int | rowCount (const QModelIndex &parent={}) const override |
| |
| int | columnCount (const QModelIndex &parent={}) const override |
| |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| |
| Qt::DropActions | supportedDropActions () const override |
| |
| QStringList | mimeTypes () const override |
| |
| QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| |
| bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
| |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| |
◆ Role
| Enumerator |
|---|
| RoleCategory | |
| RoleRow | |
| RoleIsLeaf | |
| RoleObjectRef | |
| RoleSection | |
| RoleDataCategory | |
◆ Section
Slice BM.0 — top-level partitioning of the tree.
| Enumerator |
|---|
| SectionNetwork | Spatial categories (Junctions … Rain Gages)
|
| SectionDivider | Visual separator row (non-selectable)
|
| SectionData | Non-spatial data objects (Curves … Inlets)
|
◆ SWMMObjectTreeModel()
| SWMMObjectTreeModel::SWMMObjectTreeModel |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~SWMMObjectTreeModel()
| SWMMObjectTreeModel::~SWMMObjectTreeModel |
( |
| ) |
|
|
overridedefault |
◆ canDropMimeData()
| bool SWMMObjectTreeModel::canDropMimeData |
( |
const QMimeData * |
data, |
|
|
Qt::DropAction |
action, |
|
|
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| const |
|
override |
◆ categoryAtTopRow()
Which SWMMModelLayer::Category is rendered at top-level row topRow, or NumCategories if the row is out of range or the row is a data / divider row.
◆ columnCount()
| int SWMMObjectTreeModel::columnCount |
( |
const QModelIndex & |
parent = {} | ) |
const |
|
override |
◆ data()
| QVariant SWMMObjectTreeModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
override |
◆ dataCategoryAtTopRow()
Slice BM.0 — which SWMMModelLayer::DataCategory is rendered at top-level row topRow, or NumDataCategories when out of range or the row is in another section.
◆ dropMimeData()
| bool SWMMObjectTreeModel::dropMimeData |
( |
const QMimeData * |
data, |
|
|
Qt::DropAction |
action, |
|
|
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| |
|
override |
◆ flags()
| Qt::ItemFlags SWMMObjectTreeModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
override |
◆ headerData()
| QVariant SWMMObjectTreeModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
override |
◆ index()
| QModelIndex SWMMObjectTreeModel::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent = {} |
|
) |
| const |
|
override |
◆ indexFor() [1/2]
| QModelIndex SWMMObjectTreeModel::indexFor |
( |
const SWMMObjectRef & |
ref | ) |
const |
Convenience: model index for a selection-bus object. Walks the layer's name→(cat,row) map — O(1) hash lookup. Returns an invalid QModelIndex when the object is unknown.
◆ indexFor() [2/2]
Model index for a specific leaf (category, row), or invalid if either is out of range / the category is hidden.
◆ mimeData()
| QMimeData * SWMMObjectTreeModel::mimeData |
( |
const QModelIndexList & |
indexes | ) |
const |
|
override |
◆ mimeTypes()
| QStringList SWMMObjectTreeModel::mimeTypes |
( |
| ) |
const |
|
override |
◆ parent()
| QModelIndex SWMMObjectTreeModel::parent |
( |
const QModelIndex & |
child | ) |
const |
|
override |
◆ reload
| void SWMMObjectTreeModel::reload |
( |
| ) |
|
|
slot |
Full reset — call when the layer's SoA has been replaced wholesale (model reload / CRS reproject / add-node that shifts the category counts).
◆ rowCount()
| int SWMMObjectTreeModel::rowCount |
( |
const QModelIndex & |
parent = {} | ) |
const |
|
override |
◆ scheduleReload
| void SWMMObjectTreeModel::scheduleReload |
( |
| ) |
|
|
slot |
Coalescing wrapper — schedules a single reload() on the next event-loop turn no matter how many change signals fire this turn. Data-object mutations arrive in bursts (a registry rename fires remove+add pairs; bulk imports fire per object) and some fire BEFORE the mutation completes (providerAboutToBeRemoved), so the deferred reload both dedupes and reads post-mutation state.
◆ sectionAtTopRow()
Slice BM.0 — section discriminator for a top-level row.
◆ setData()
| bool SWMMObjectTreeModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
override |
◆ setLayer()
Bind the model to a SWMM layer. Triggers beginResetModel / endResetModel and rebuilds the cached visible-category list. Pass nullptr to detach.
◆ supportedDropActions()
| Qt::DropActions SWMMObjectTreeModel::supportedDropActions |
( |
| ) |
const |
|
override |
◆ topRowForCategory()
Top-level row for a given category, or -1 when that category contains no visible objects (empty categories are omitted).
◆ topRowForDataCategory()
Slice BM.0 — top-level row for a given data category, or -1 when empty / not currently shown.
The documentation for this class was generated from the following files: