QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsCombinedStyleModel Class Reference

A model which contains entities from multiple QgsStyle databases. More...

#include <qgscombinedstylemodel.h>

Inheritance diagram for QgsCombinedStyleModel:

Public Member Functions

 QgsCombinedStyleModel (QObject *parent=nullptr)
 Constructor for QgsCombinedStyleModel with the specified parent object.
void addDefaultStyle ()
 Adds the default style (QgsStyle::defaultStyle()) to the model.
void addDesiredIconSize (QSize size)
 Adds an additional icon size to generate for Qt::DecorationRole data.
void addStyle (QgsStyle *style)
 Adds a style to the model.
void addTargetScreenProperties (const QgsScreenProperties &properties)
 Adds additional target screen properties to use when generating icons for Qt::DecorationRole data.
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
void removeStyle (QgsStyle *style)
 Removes a style from the model.
QList< QgsStyle * > styles () const
 Returns a list of all styles shown in the model.

Detailed Description

A model which contains entities from multiple QgsStyle databases.

Note
Only available in builds based on Qt 5.13 or later
Since
QGIS 3.26

Definition at line 40 of file qgscombinedstylemodel.h.

Constructor & Destructor Documentation

◆ QgsCombinedStyleModel()

QgsCombinedStyleModel::QgsCombinedStyleModel ( QObject * parent = nullptr)
explicit

Constructor for QgsCombinedStyleModel with the specified parent object.

Definition at line 25 of file qgscombinedstylemodel.cpp.

Member Function Documentation

◆ addDefaultStyle()

void QgsCombinedStyleModel::addDefaultStyle ( )

Adds the default style (QgsStyle::defaultStyle()) to the model.

See also
addStyle()

Definition at line 109 of file qgscombinedstylemodel.cpp.

◆ addDesiredIconSize()

void QgsCombinedStyleModel::addDesiredIconSize ( QSize size)

Adds an additional icon size to generate for Qt::DecorationRole data.

This allows style icons to be generated at an icon size which corresponds exactly to the view's icon size in which this model is used.

Definition at line 154 of file qgscombinedstylemodel.cpp.

◆ addStyle()

void QgsCombinedStyleModel::addStyle ( QgsStyle * style)

Adds a style to the model.

Ownership of style is not transferred.

See also
styles()
addDefaultStyle()
removeStyle()

Definition at line 36 of file qgscombinedstylemodel.cpp.

◆ addTargetScreenProperties()

void QgsCombinedStyleModel::addTargetScreenProperties ( const QgsScreenProperties & properties)

Adds additional target screen properties to use when generating icons for Qt::DecorationRole data.

This allows style icons to be generated at an icon device pixel ratio and DPI which corresponds exactly to the view's screen properties in which this model is used.

Since
QGIS 3.32

Definition at line 170 of file qgscombinedstylemodel.cpp.

◆ headerData()

QVariant QgsCombinedStyleModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

Definition at line 31 of file qgscombinedstylemodel.cpp.

◆ removeStyle()

void QgsCombinedStyleModel::removeStyle ( QgsStyle * style)

Removes a style from the model.

See also
addStyle()

Definition at line 91 of file qgscombinedstylemodel.cpp.

◆ styles()

QList< QgsStyle * > QgsCombinedStyleModel::styles ( ) const

Returns a list of all styles shown in the model.

See also
addStyle()

Definition at line 149 of file qgscombinedstylemodel.cpp.


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