Qt Utilities 6.14.3
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Loading...
Searching...
No Matches
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.
 
 OptionCategoryModel (const QList< OptionCategory * > &categories, QObject *parent=nullptr)
 Constructs an option category model with the specified categories.
 
 ~OptionCategoryModel () override
 Destroys the option category model.
 
const QList< OptionCategory * > & categories () const
 Returns the categories.
 
OptionCategorycategory (const QModelIndex &index) const
 Returns the category for the specified model index.
 
OptionCategorycategory (int row) const
 Returns the category for the specified row.
 
void setCategories (const QList< OptionCategory * > &categories)
 Sets the categories for the model.
 
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 22 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 31 of file optioncategorymodel.cpp.

◆ ~OptionCategoryModel()

QtUtilities::OptionCategoryModel::~OptionCategoryModel ( )
override

Destroys the option category model.

Definition at line 43 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 70 of file optioncategorymodel.cpp.

◆ rowCount()

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

Definition at line 65 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 52 of file optioncategorymodel.cpp.

Property Documentation

◆ categories

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

Definition at line 16 of file optioncategorymodel.h.


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