QGIS API Documentation 4.3.0-Master (0cfde48c85b)
Loading...
Searching...
No Matches
QgsMapLayerStyleModel Class Reference

A model for display of styles from a QgsMapLayerStyleManager. More...

#include <qgsmaplayerstylemanagerwidget.h>

Inheritance diagram for QgsMapLayerStyleModel:

Public Member Functions

 QgsMapLayerStyleModel (QgsMapLayerStyleManager *manager, QObject *parent=nullptr)
 Constructor for QgsMapLayerStyleModel, showing styles from the specified manager.
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Qt::ItemFlags flags (const QModelIndex &index) const override
QModelIndex indexForName (const QString &name) const
 Returns the model index corresponding to the specified style name.
int rowCount (const QModelIndex &parent=QModelIndex()) const override
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override

Detailed Description

A model for display of styles from a QgsMapLayerStyleManager.

Also allows for renaming of styles.

Since
QGIS 4.4

Definition at line 38 of file qgsmaplayerstylemanagerwidget.h.

Constructor & Destructor Documentation

◆ QgsMapLayerStyleModel()

QgsMapLayerStyleModel::QgsMapLayerStyleModel ( QgsMapLayerStyleManager * manager,
QObject * parent = nullptr )

Constructor for QgsMapLayerStyleModel, showing styles from the specified manager.

Definition at line 49 of file qgsmaplayerstylemanagerwidget.cpp.

Member Function Documentation

◆ data()

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

Definition at line 71 of file qgsmaplayerstylemanagerwidget.cpp.

◆ flags()

Qt::ItemFlags QgsMapLayerStyleModel::flags ( const QModelIndex & index) const
override

Definition at line 117 of file qgsmaplayerstylemanagerwidget.cpp.

◆ indexForName()

QModelIndex QgsMapLayerStyleModel::indexForName ( const QString & name) const

Returns the model index corresponding to the specified style name.

Definition at line 130 of file qgsmaplayerstylemanagerwidget.cpp.

◆ rowCount()

int QgsMapLayerStyleModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

Definition at line 63 of file qgsmaplayerstylemanagerwidget.cpp.

◆ setData()

bool QgsMapLayerStyleModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override

Definition at line 89 of file qgsmaplayerstylemanagerwidget.cpp.


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