QLThemeComboBoxItemModel Class
#include <QLayers/qlthemecomboboxitemmodel.h>
Inherits: | QAbstractListModel |
Public Functions
QLThemeComboBoxItemModel(QObject* parent = nullptr) | |
void | append(LTheme* theme) |
void | clear() |
virtual QVariant | data(const QModelIndex& index, int role) const override |
virtual int | rowCount(const QModelIndex& parent = QModelIndex()) const override |
Detailed Description
A QLThemeComboBoxItemModel is a QAbstractListModel that implements a list model for LTheme data.
Member Function Documentation
QLThemeComboBoxItemModel(QObject* parent = nullptr)
Constructs an item model for a theme combo box.
void append(LTheme* theme)
Adds theme to the list of themes that the model represents.
void clear()
Clears the model data.
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 the LTheme specified by index |
Qt::UserRole | Pointer to the LTheme specified by index |
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.