Qt Utilities  5.12.1
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Public Member Functions | List of all members
Dialogs::OptionCategoryModel Class Reference

The OptionCategoryModel class is used by SettingsDialog to store and display option categories. More...

#include <optioncategorymodel.h>

Inheritance diagram for Dialogs::OptionCategoryModel:
[legend]
Collaboration diagram for Dialogs::OptionCategoryModel:
[legend]

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 () override
 Destroys the option category model. More...
 
const QList< OptionCategory * > & categories () const
 Returns the categories. More...
 
OptionCategorycategory (const QModelIndex &index) const
 Returns the category for the specified model index. More...
 
OptionCategorycategory (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 override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 

Detailed Description

The OptionCategoryModel class is used by SettingsDialog to store and display option categories.

Definition at line 14 of file optioncategorymodel.h.

Constructor & Destructor Documentation

◆ OptionCategoryModel() [1/2]

Dialogs::OptionCategoryModel::OptionCategoryModel ( QObject *  parent = nullptr)
explicit

Constructs an option category model.

Definition at line 20 of file optioncategorymodel.cpp.

◆ OptionCategoryModel() [2/2]

Dialogs::OptionCategoryModel::OptionCategoryModel ( const QList< OptionCategory *> &  categories,
QObject *  parent = nullptr 
)
explicit

Constructs an option category model with the specified categories.

Remarks
The model takes ownership over the given categories.

Definition at line 29 of file optioncategorymodel.cpp.

◆ ~OptionCategoryModel()

Dialogs::OptionCategoryModel::~OptionCategoryModel ( )
overridevirtual

Destroys the option category model.

Definition at line 41 of file optioncategorymodel.cpp.

Member Function Documentation

◆ categories()

const QList< OptionCategory * > & Dialogs::OptionCategoryModel::categories ( ) const
inline

Returns the categories.

See also
OptionCategoryModel::category()
OptionCategoryModel::setCategories()

Definition at line 41 of file optioncategorymodel.h.

◆ category() [1/2]

OptionCategory * Dialogs::OptionCategoryModel::category ( const QModelIndex &  index) const
inline

Returns the category for the specified model index.

See also
OptionCategoryModel::categories()
OptionCategoryModel::setCategories()

Definition at line 51 of file optioncategorymodel.h.

◆ category() [2/2]

OptionCategory * Dialogs::OptionCategoryModel::category ( int  row) const
inline

Returns the category for the specified row.

See also
OptionCategoryModel::categories()
OptionCategoryModel::setCategories()

Definition at line 61 of file optioncategorymodel.h.

◆ data()

QVariant Dialogs::OptionCategoryModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 68 of file optioncategorymodel.cpp.

◆ rowCount()

int Dialogs::OptionCategoryModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 63 of file optioncategorymodel.cpp.

◆ setCategories()

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.


The documentation for this class was generated from the following files: