1 #ifndef DIALOGS_OPTIONCATEGORYMODEL_H 2 #define DIALOGS_OPTIONCATEGORYMODEL_H 6 #include <QAbstractListModel> 18 explicit OptionCategoryModel(
const QList<OptionCategory *> &categories, QObject *parent =
nullptr);
21 const QList<OptionCategory *> &categories()
const;
24 void setCategories(
const QList<OptionCategory *> categories);
25 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
26 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
29 void categoryChangedName();
30 void categoryChangedIcon();
33 QList<OptionCategory *> m_categories;
53 return (index.isValid()) ?
category(index.row()) :
nullptr;
63 return row < m_categories.size() ? m_categories.at(row) :
nullptr;
67 #endif // DIALOGS_OPTIONCATEGORYMODEL_H The OptionCategoryModel class is used by SettingsDialog to store and display option categories.
The OptionCategory class wraps associated option pages.
OptionCategory * category(const QModelIndex &index) const
Returns the category for the specified model index.
const QList< OptionCategory * > & categories() const
Returns the categories.
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
Provides common dialogs such as AboutDialog, EnterPasswordDialog and SettingsDialog.