Qt Utilities
5.10.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
The OptionCategoryModel class is used by SettingsDialog to store and display option categories. More...
#include <optioncategorymodel.h>
Public Member Functions | |
OptionCategoryModel (QObject *parent=nullptr) | |
Constructs an option category model. More... | |
OptionCategoryModel (const QList< OptionCategory *> &categories, QObject *parent=nullptr) | |
Constructs an option category model with the specified categories. More... | |
virtual | ~OptionCategoryModel () |
Destroys the option category model. More... | |
const QList< OptionCategory * > & | categories () const |
Returns the categories. More... | |
OptionCategory * | category (const QModelIndex &index) const |
Returns the category for the specified model index. More... | |
OptionCategory * | category (int row) const |
Returns the category for the specified row. More... | |
void | setCategories (const QList< OptionCategory *> categories) |
Sets the categories for the model. More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
The OptionCategoryModel class is used by SettingsDialog to store and display option categories.
Definition at line 14 of file optioncategorymodel.h.
|
explicit |
Constructs an option category model.
Definition at line 20 of file optioncategorymodel.cpp.
|
explicit |
Constructs an option category model with the specified categories.
Definition at line 29 of file optioncategorymodel.cpp.
|
virtual |
Destroys the option category model.
Definition at line 41 of file optioncategorymodel.cpp.
|
inline |
Returns the categories.
Definition at line 41 of file optioncategorymodel.h.
|
inline |
Returns the category for the specified model index.
Definition at line 51 of file optioncategorymodel.h.
|
inline |
Returns the category for the specified row.
Definition at line 61 of file optioncategorymodel.h.
QVariant Dialogs::OptionCategoryModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const |
Definition at line 68 of file optioncategorymodel.cpp.
int Dialogs::OptionCategoryModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Definition at line 63 of file optioncategorymodel.cpp.
void Dialogs::OptionCategoryModel::setCategories | ( | const QList< OptionCategory *> | categories | ) |
Sets the categories for the model.
The model takes ownership over the given categories.
Definition at line 50 of file optioncategorymodel.cpp.