QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
40 qDeleteAll( mRenderers );
45 return mRenderers.keys();
50 QStringList ids = mRenderers.keys();
52 std::sort( ids.begin(), ids.end(), [ = ](
const QString & a,
const QString & b )->bool
54 if ( sortKey( a ) < sortKey( b ) )
56 else if ( sortKey( a ) > sortKey( b ) )
60 int res = QString::localeAwareCompare( visibleName( a ), visibleName( b ) );
89 if ( mRenderers.contains(
id ) )
90 return mRenderers.value(
id )->clone();
97 if ( mRenderers.contains(
id ) )
98 return mRenderers.value(
id )->visibleName();
105 if ( mRenderers.contains(
id ) )
106 return mRenderers.value(
id )->sortKey();
int sortKey(const QString &id) const
Returns the sorting key for the renderer with matching id.
virtual QString id() const =0
Returns the unique ID for this renderer.
@ TicksUp
Render ticks above line.
QStringList renderers() const
Returns a list of the renderer ids currently contained in the registry.
QString visibleName(const QString &id) const
Returns the translated, user-visible name for the renderer with matching id.
@ TicksMiddle
Render ticks crossing line.
@ TicksDown
Render ticks below line.
void removeRenderer(const QString &id)
Removes the renderer with matching id from the registry.
void addRenderer(QgsScaleBarRenderer *renderer)
Adds a new renderer to the registry.
QgsScaleBarRendererRegistry()
You should not normally need to create your own scalebar renderer registry.
QStringList sortedRendererList() const
Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting...
QgsScaleBarRenderer * renderer(const QString &id) const
Creates a new scalebar renderer by id.
~QgsScaleBarRendererRegistry()