Public Functions
QLThemeModel(QObject* parent = nullptr) | |
virtual int | columnCount(const QModelIndex& parent = QModelIndex()) const override |
virtual QVariant | data(const QModelIndex& index, int role) const override |
virtual QModelIndex | index(int row, int column, const QModelIndex& parent = QModelIndex()) const override |
virtual QModelIndex | parent(const QModelIndex& index) const override |
virtual int | rowCount(const QModelIndex& parent = QModelIndex()) const override |
void | set_theme(LTheme* theme) |
Detailed Description
A QLThemeModel is a QAbstractItemModel that implements an item model for LTheme data.
Member Function Documentation
QLThemeModel(QObject* parent = nullptr)
Constructs a theme model.
int columnCount(const QModelIndex& parent = QModelIndex()) const
Virtual
Override
Returns 1 since theme data is not structured multidimensionally.
QVariant data(const QModelIndex& index, int role) const
Virtual
Override
Returns a QVariant containing data for the specified index.
The type of data returned depends on the specified Qt::ItemDataRole role. The following table describes the available roles and the data returned:
Role | QVariant Data |
---|---|
Qt::DisplayRole | QString name of LThemeItem specified by index |
Qt::UserRole | Pointer to LThemeItem specified by index |
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const
Virtual
Override
Returns the index of the item in the model specified by the given row, column and parent index.
QModelIndex parent(const QModelIndex& index) const
Virtual
Override
Returns the parent of the model item with the given index. If the item has no parent, a invalid QModelIndex is returned.
int rowCount(const QModelIndex& parent = QModelIndex()) const
Virtual
Override
Returns the number of rows under the given parent. When the parent is valid it means that rowCount() is returning the number of children of parent.