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
openswmmvis::ui::RuleListModel Class Reference

#include <rulelistmodel.h>

Inheritance diagram for openswmmvis::ui::RuleListModel:
Collaboration diagram for openswmmvis::ui::RuleListModel:

Public Member Functions

 RuleListModel (SWMMModelLayer *layer, QObject *parent=nullptr)
 Construct over the layer + its (lazily-created) registry. The model holds QPointers so a layer/registry swap during project switch falls through to an empty rowCount() rather than crashing.
 
 ~RuleListModel () override
 
int rowCount (const QModelIndex &parent=QModelIndex()) 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
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
int indexOf (const QString &name) const
 Look up the row index of a rule by name, or -1 if not present. Used by RulesEditorDialog::openForRule to drive the list-view selection.
 
QString nameAt (int row) const
 Read the rule name at a given row, or empty if out of bounds.
 

Constructor & Destructor Documentation

◆ RuleListModel()

openswmmvis::ui::RuleListModel::RuleListModel ( SWMMModelLayer layer,
QObject *  parent = nullptr 
)
explicit

Construct over the layer + its (lazily-created) registry. The model holds QPointers so a layer/registry swap during project switch falls through to an empty rowCount() rather than crashing.

◆ ~RuleListModel()

openswmmvis::ui::RuleListModel::~RuleListModel ( )
overridedefault

Member Function Documentation

◆ data()

QVariant openswmmvis::ui::RuleListModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

◆ flags()

Qt::ItemFlags openswmmvis::ui::RuleListModel::flags ( const QModelIndex &  index) const
override

◆ headerData()

QVariant openswmmvis::ui::RuleListModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

◆ indexOf()

int openswmmvis::ui::RuleListModel::indexOf ( const QString &  name) const

Look up the row index of a rule by name, or -1 if not present. Used by RulesEditorDialog::openForRule to drive the list-view selection.

Here is the caller graph for this function:

◆ nameAt()

QString openswmmvis::ui::RuleListModel::nameAt ( int  row) const

Read the rule name at a given row, or empty if out of bounds.

◆ removeRows()

bool openswmmvis::ui::RuleListModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

◆ rowCount()

int openswmmvis::ui::RuleListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override
Here is the caller graph for this function:

◆ setData()

bool openswmmvis::ui::RuleListModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

The documentation for this class was generated from the following files: