QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | Protected Attributes | List of all members
QgsCalloutAbstractMetadata Class Referenceabstract

Stores metadata about one callout renderer class. More...

#include <qgscalloutsregistry.h>

Inheritance diagram for QgsCalloutAbstractMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsCalloutAbstractMetadata (const QString &name, const QString &visibleName, const QIcon &icon=QIcon())
 Constructor for QgsCalloutAbstractMetadata, with the specified name. More...
 
virtual ~QgsCalloutAbstractMetadata ()=default
 
virtual QgsCalloutcreateCallout (const QVariantMap &properties, const QgsReadWriteContext &context)=0
 Create a callout of this type given the map of properties. More...
 
virtual QgsCalloutWidgetcreateCalloutWidget (QgsVectorLayer *)
 Creates a widget for configuring callouts of this type. More...
 
QIcon icon () const
 Returns an icon representing the callout. More...
 
QString name () const
 Returns the unique name of the callout type. More...
 
void setIcon (const QIcon &icon)
 Sets an icon representing the callout. More...
 
QString visibleName () const
 Returns a friendly display name of the callout type. More...
 

Protected Attributes

QIcon mIcon
 
QString mName
 
QString mVisibleName
 

Detailed Description

Stores metadata about one callout renderer class.

Note
It's necessary to implement createCallout() function. In C++ you can use QgsCalloutMetadata convenience class.
Since
QGIS 3.10

Definition at line 39 of file qgscalloutsregistry.h.

Constructor & Destructor Documentation

◆ QgsCalloutAbstractMetadata()

QgsCalloutAbstractMetadata::QgsCalloutAbstractMetadata ( const QString &  name,
const QString &  visibleName,
const QIcon &  icon = QIcon() 
)
inline

Constructor for QgsCalloutAbstractMetadata, with the specified name.

The visibleName argument gives a translated, user friendly string identifying the callout type.

The icon argument can be used to specify an icon representing the callout.

Definition at line 50 of file qgscalloutsregistry.h.

◆ ~QgsCalloutAbstractMetadata()

virtual QgsCalloutAbstractMetadata::~QgsCalloutAbstractMetadata ( )
virtualdefault

Member Function Documentation

◆ createCallout()

virtual QgsCallout* QgsCalloutAbstractMetadata::createCallout ( const QVariantMap &  properties,
const QgsReadWriteContext context 
)
pure virtual

Create a callout of this type given the map of properties.

Ownership of the callout is transferred to the caller.

Implemented in QgsCalloutMetadata.

◆ createCalloutWidget()

QgsCalloutWidget * QgsCalloutAbstractMetadata::createCalloutWidget ( QgsVectorLayer )
virtual

Creates a widget for configuring callouts of this type.

Can return nullptr if there's no GUI required.

Ownership of the widget is transferred to the caller.

Reimplemented in QgsCalloutMetadata.

Definition at line 25 of file qgscalloutsregistry.cpp.

◆ icon()

QIcon QgsCalloutAbstractMetadata::icon ( ) const
inline

Returns an icon representing the callout.

See also
setIcon()

Definition at line 74 of file qgscalloutsregistry.h.

◆ name()

QString QgsCalloutAbstractMetadata::name ( ) const
inline

Returns the unique name of the callout type.

This value is not translated.

See also
visibleName()

Definition at line 62 of file qgscalloutsregistry.h.

◆ setIcon()

void QgsCalloutAbstractMetadata::setIcon ( const QIcon &  icon)
inline

Sets an icon representing the callout.

See also
icon()

Definition at line 80 of file qgscalloutsregistry.h.

◆ visibleName()

QString QgsCalloutAbstractMetadata::visibleName ( ) const
inline

Returns a friendly display name of the callout type.

This value is translated.

See also
name()

Definition at line 68 of file qgscalloutsregistry.h.

Member Data Documentation

◆ mIcon

QIcon QgsCalloutAbstractMetadata::mIcon
protected

Definition at line 99 of file qgscalloutsregistry.h.

◆ mName

QString QgsCalloutAbstractMetadata::mName
protected

Definition at line 97 of file qgscalloutsregistry.h.

◆ mVisibleName

QString QgsCalloutAbstractMetadata::mVisibleName
protected

Definition at line 98 of file qgscalloutsregistry.h.


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