QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsMapLayerStyleCategoriesModel Class Reference

Model for layer style categories. More...

#include <qgsmaplayerstylecategoriesmodel.h>

Inheritance diagram for QgsMapLayerStyleCategoriesModel:

Public Types

enum class  Role : int { NameRole = Qt::UserRole + 1 }
 Custom model roles. More...

Public Member Functions

 QgsMapLayerStyleCategoriesModel (Qgis::LayerType type, QObject *parent=nullptr)
 Constructor for QgsMapLayerStyleCategoriesModel, for the specified layer type.
QgsMapLayer::StyleCategories categories () const
 Returns the categories as defined in the model.
int columnCount (const QModelIndex &=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role) const override
Qt::ItemFlags flags (const QModelIndex &) const override
int rowCount (const QModelIndex &=QModelIndex()) const override
void setCategories (QgsMapLayer::StyleCategories categories)
 Reset the model data.
bool setData (const QModelIndex &index, const QVariant &value, int role) override
void setShowAllCategories (bool showAll)
 Defines if the model should list the AllStyleCategories entry.

Detailed Description

Model for layer style categories.

Since
QGIS 3.14

Definition at line 32 of file qgsmaplayerstylecategoriesmodel.h.

Member Enumeration Documentation

◆ Role

enum class QgsMapLayerStyleCategoriesModel::Role : int
strong

Custom model roles.

Enumerator
NameRole 

Definition at line 38 of file qgsmaplayerstylecategoriesmodel.h.

Constructor & Destructor Documentation

◆ QgsMapLayerStyleCategoriesModel()

QgsMapLayerStyleCategoriesModel::QgsMapLayerStyleCategoriesModel ( Qgis::LayerType type,
QObject * parent = nullptr )
explicit

Constructor for QgsMapLayerStyleCategoriesModel, for the specified layer type.

Definition at line 22 of file qgsmaplayerstylecategoriesmodel.cpp.

Member Function Documentation

◆ categories()

QgsMapLayer::StyleCategories QgsMapLayerStyleCategoriesModel::categories ( ) const

Returns the categories as defined in the model.

Definition at line 100 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ columnCount()

int QgsMapLayerStyleCategoriesModel::columnCount ( const QModelIndex & = QModelIndex()) const
override

Definition at line 135 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ data()

QVariant QgsMapLayerStyleCategoriesModel::data ( const QModelIndex & index,
int role ) const
override

Definition at line 140 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ flags()

Qt::ItemFlags QgsMapLayerStyleCategoriesModel::flags ( const QModelIndex & ) const
override

Definition at line 563 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ rowCount()

int QgsMapLayerStyleCategoriesModel::rowCount ( const QModelIndex & = QModelIndex()) const
override

Definition at line 112 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ setCategories()

void QgsMapLayerStyleCategoriesModel::setCategories ( QgsMapLayer::StyleCategories categories)

Reset the model data.

Definition at line 82 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ setData()

bool QgsMapLayerStyleCategoriesModel::setData ( const QModelIndex & index,
const QVariant & value,
int role )
override

Definition at line 538 of file qgsmaplayerstylecategoriesmodel.cpp.

◆ setShowAllCategories()

void QgsMapLayerStyleCategoriesModel::setShowAllCategories ( bool showAll)

Defines if the model should list the AllStyleCategories entry.

Definition at line 105 of file qgsmaplayerstylecategoriesmodel.cpp.


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