QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Signals | Public Member Functions | List of all members
QgsAbstractStyleEntityIconGenerator Class Referenceabstract

An abstract base class for icon generators for a QgsStyleModel. More...

#include <qgsstylemodel.h>

Inheritance diagram for QgsAbstractStyleEntityIconGenerator:
Inheritance graph
[legend]

Signals

void iconGenerated (QgsStyle::StyleEntity type, const QString &name, const QIcon &icon)
 Emitted when the icon for the style entity with matching type and name has been generated. More...
 

Public Member Functions

 QgsAbstractStyleEntityIconGenerator (QObject *parent)
 Constructor for QgsAbstractStyleEntityIconGenerator, with the specified parent object. More...
 
virtual void generateIcon (QgsStyle *style, QgsStyle::StyleEntity type, const QString &name)=0
 Triggers generation of an icon for an entity from the specified style database, with matching entity type and name. More...
 
QList< QSize > iconSizes () const
 Returns the list of icon sizes to generate. More...
 
void setIconSizes (const QList< QSize > &sizes)
 Sets the list of icon sizes to generate. More...
 
void setTargetScreenProperties (const QSet< QgsScreenProperties > &properties)
 Sets the target screen properties to use when generating icons. More...
 
QSet< QgsScreenPropertiestargetScreenProperties () const
 Returns the target screen properties to use when generating icons. More...
 

Detailed Description

An abstract base class for icon generators for a QgsStyleModel.

This base class allows for creation of specialized icon generators for entities in a style database, and allows for deferred icon generation.

Note
Not available in Python bindings
Since
QGIS 3.16

Definition at line 44 of file qgsstylemodel.h.

Constructor & Destructor Documentation

◆ QgsAbstractStyleEntityIconGenerator()

QgsAbstractStyleEntityIconGenerator::QgsAbstractStyleEntityIconGenerator ( QObject *  parent)

Constructor for QgsAbstractStyleEntityIconGenerator, with the specified parent object.

Definition at line 39 of file qgsstylemodel.cpp.

Member Function Documentation

◆ generateIcon()

virtual void QgsAbstractStyleEntityIconGenerator::generateIcon ( QgsStyle style,
QgsStyle::StyleEntity  type,
const QString &  name 
)
pure virtual

Triggers generation of an icon for an entity from the specified style database, with matching entity type and name.

◆ iconGenerated

void QgsAbstractStyleEntityIconGenerator::iconGenerated ( QgsStyle::StyleEntity  type,
const QString &  name,
const QIcon &  icon 
)
signal

Emitted when the icon for the style entity with matching type and name has been generated.

◆ iconSizes()

QList< QSize > QgsAbstractStyleEntityIconGenerator::iconSizes ( ) const

Returns the list of icon sizes to generate.

See also
setIconSizes()

Definition at line 49 of file qgsstylemodel.cpp.

◆ setIconSizes()

void QgsAbstractStyleEntityIconGenerator::setIconSizes ( const QList< QSize > &  sizes)

Sets the list of icon sizes to generate.

See also
iconSizes()

Definition at line 44 of file qgsstylemodel.cpp.

◆ setTargetScreenProperties()

void QgsAbstractStyleEntityIconGenerator::setTargetScreenProperties ( const QSet< QgsScreenProperties > &  properties)

Sets the target screen properties to use when generating icons.

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.

See also
targetScreenProperties()
Since
QGIS 3.32

Definition at line 54 of file qgsstylemodel.cpp.

◆ targetScreenProperties()

QSet< QgsScreenProperties > QgsAbstractStyleEntityIconGenerator::targetScreenProperties ( ) const

Returns the target screen properties to use when generating icons.

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.

See also
setTargetScreenProperties()
Since
QGIS 3.32

Definition at line 59 of file qgsstylemodel.cpp.


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