QGIS API Documentation  3.14.0-Pi (9f7028fd23)
Public Member Functions | List of all members
QgsScaleBarRendererRegistry Class Reference

#include <qgsscalebarrendererregistry.h>

Public Member Functions

 QgsScaleBarRendererRegistry ()
 You should not normally need to create your own scalebar renderer registry. More...
 
 ~QgsScaleBarRendererRegistry ()
 
void addRenderer (QgsScaleBarRenderer *renderer)
 Adds a new renderer to the registry. More...
 
void removeRenderer (const QString &id)
 Removes the renderer with matching id from the registry. More...
 
QgsScaleBarRendererrenderer (const QString &id) const
 Creates a new scalebar renderer by id. More...
 
QStringList renderers () const
 Returns a list of the renderer ids currently contained in the registry. More...
 
QStringList sortedRendererList () const
 Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting the renderer's sort keys and display strings. More...
 
int sortKey (const QString &id) const
 Returns the sorting key for the renderer with matching id. More...
 
QString visibleName (const QString &id) const
 Returns the translated, user-visible name for the renderer with matching id. More...
 

Detailed Description

The QgsScaleBarRendererRegistry manages registered scalebar renderers.

A reference to the QgsScaleBarRendererRegistry can be obtained from QgsApplication::scalebarRendererRegistry().

Since
QGIS 3.14

Definition at line 33 of file qgsscalebarrendererregistry.h.

Constructor & Destructor Documentation

◆ QgsScaleBarRendererRegistry()

QgsScaleBarRendererRegistry::QgsScaleBarRendererRegistry ( )
explicit

You should not normally need to create your own scalebar renderer registry.

Use the one provided by QgsApplication::scalebarRendererRegistry() instead.

Definition at line 26 of file qgsscalebarrendererregistry.cpp.

◆ ~QgsScaleBarRendererRegistry()

QgsScaleBarRendererRegistry::~QgsScaleBarRendererRegistry ( )

Definition at line 38 of file qgsscalebarrendererregistry.cpp.

Member Function Documentation

◆ addRenderer()

void QgsScaleBarRendererRegistry::addRenderer ( QgsScaleBarRenderer renderer)

Adds a new renderer to the registry.

Ownership is transferred to the registry.

Definition at line 71 of file qgsscalebarrendererregistry.cpp.

◆ removeRenderer()

void QgsScaleBarRendererRegistry::removeRenderer ( const QString &  id)

Removes the renderer with matching id from the registry.

Definition at line 79 of file qgsscalebarrendererregistry.cpp.

◆ renderer()

QgsScaleBarRenderer * QgsScaleBarRendererRegistry::renderer ( const QString &  id) const

Creates a new scalebar renderer by id.

If there is no such id registered, nullptr will be returned instead.

The caller takes ownership of the returned object.

Definition at line 87 of file qgsscalebarrendererregistry.cpp.

◆ renderers()

QStringList QgsScaleBarRendererRegistry::renderers ( ) const

Returns a list of the renderer ids currently contained in the registry.

Definition at line 43 of file qgsscalebarrendererregistry.cpp.

◆ sortedRendererList()

QStringList QgsScaleBarRendererRegistry::sortedRendererList ( ) const

Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting the renderer's sort keys and display strings.

Definition at line 48 of file qgsscalebarrendererregistry.cpp.

◆ sortKey()

int QgsScaleBarRendererRegistry::sortKey ( const QString &  id) const

Returns the sorting key for the renderer with matching id.

Definition at line 103 of file qgsscalebarrendererregistry.cpp.

◆ visibleName()

QString QgsScaleBarRendererRegistry::visibleName ( const QString &  id) const

Returns the translated, user-visible name for the renderer with matching id.

Definition at line 95 of file qgsscalebarrendererregistry.cpp.


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