1 #ifndef DIALOGS_OPTIONCATEGORYMODEL_H
2 #define DIALOGS_OPTIONCATEGORYMODEL_H
6 #include <QAbstractListModel>
16 Q_PROPERTY(QList<OptionCategory *> categories READ categories WRITE setCategories)
19 explicit OptionCategoryModel(
const QList<OptionCategory *> &categories, QObject *parent =
nullptr);
22 const QList<OptionCategory *> &categories()
const;
25 void setCategories(
const QList<OptionCategory *> &categories);
26 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
27 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
30 void categoryChangedName();
31 void categoryChangedIcon();
34 QList<OptionCategory *> m_categories;
54 return (index.isValid()) ?
category(index.row()) :
nullptr;
64 return row < m_categories.size() ? m_categories.at(row) :
nullptr;
The OptionCategoryModel class is used by SettingsDialog to store and display option categories.
OptionCategory * category(const QModelIndex &index) const
Returns the category for the specified model index.
QList< OptionCategory * > categories
The OptionCategory class wraps associated option pages.
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.