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

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

#include <optioncategorymodel.h>

Inheritance diagram for QtUtilities::OptionCategoryModel:
[legend]
Collaboration diagram for QtUtilities::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...
 
 ~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
 

Properties

QList< OptionCategory * > categories
 

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]

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

Constructs an option category model.

Definition at line 20 of file optioncategorymodel.cpp.

◆ OptionCategoryModel() [2/2]

QtUtilities::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()

QtUtilities::OptionCategoryModel::~OptionCategoryModel ( )
override

Destroys the option category model.

Definition at line 41 of file optioncategorymodel.cpp.

Member Function Documentation

◆ categories()

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

Returns the categories.

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

Definition at line 42 of file optioncategorymodel.h.

◆ category() [1/2]

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

Returns the category for the specified model index.

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

Definition at line 52 of file optioncategorymodel.h.

◆ category() [2/2]

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

Returns the category for the specified row.

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

Definition at line 62 of file optioncategorymodel.h.

◆ data()

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

Definition at line 68 of file optioncategorymodel.cpp.

◆ rowCount()

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

Definition at line 63 of file optioncategorymodel.cpp.

◆ setCategories()

void QtUtilities::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.

Property Documentation

◆ categories

QList<OptionCategory *> QtUtilities::OptionCategoryModel::categories
readwrite

Definition at line 62 of file optioncategorymodel.h.


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