QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsPlotRegistry Class Reference

Registry of available plot types. More...

#include <qgsplotregistry.h>

Inheritance diagram for QgsPlotRegistry:

Signals

void plotAboutToBeRemoved (const QString &type)
 Emitted whenever a plot type is about to be remove from the registry, with the specified type and visible name.
void plotAdded (const QString &type, const QString &name)
 Emitted whenever a new plot type is added to the registry, with the specified type and visible name.

Public Member Functions

 QgsPlotRegistry (const QgsPlotRegistry &rh)=delete
 QgsPlotRegistry (QObject *parent=nullptr)
 Creates a new empty plot registry.
 ~QgsPlotRegistry () override
bool addPlotType (QgsPlotAbstractMetadata *metadata)
 Registers a new plot type.
QgsPlotcreatePlot (const QString &type) const
 Creates a new instance of a plot given the type.
QgsPlotRegistryoperator= (const QgsPlotRegistry &rh)=delete
QgsPlotAbstractMetadataplotMetadata (const QString &type) const
 Returns the metadata for the specified plot type.
QMap< QString, QString > plotTypes () const
 Returns a map of available plot types to translated name.
bool populate ()
 Populates the registry with standard plot types.
bool removePlotType (const QString &type)
 Removes a new a plot type from the registry.

Detailed Description

Registry of available plot types.

QgsPlotRegistry is not usually directly created, but rather accessed through QgsApplication::plotRegistry().

Since
QGIS 4.0

Definition at line 171 of file qgsplotregistry.h.

Constructor & Destructor Documentation

◆ QgsPlotRegistry() [1/2]

QgsPlotRegistry::QgsPlotRegistry ( QObject * parent = nullptr)

Creates a new empty plot registry.

QgsPlotRegistry is not usually directly created, but rather accessed through QgsApplication::plotRegistry().

See also
populate()

Definition at line 27 of file qgsplotregistry.cpp.

◆ ~QgsPlotRegistry()

QgsPlotRegistry::~QgsPlotRegistry ( )
override

Definition at line 32 of file qgsplotregistry.cpp.

◆ QgsPlotRegistry() [2/2]

QgsPlotRegistry::QgsPlotRegistry ( const QgsPlotRegistry & rh)
delete

Member Function Documentation

◆ addPlotType()

bool QgsPlotRegistry::addPlotType ( QgsPlotAbstractMetadata * metadata)

Registers a new plot type.

Note
Takes ownership of the metadata instance.

Definition at line 54 of file qgsplotregistry.cpp.

◆ createPlot()

QgsPlot * QgsPlotRegistry::createPlot ( const QString & type) const

Creates a new instance of a plot given the type.

Definition at line 74 of file qgsplotregistry.cpp.

◆ operator=()

QgsPlotRegistry & QgsPlotRegistry::operator= ( const QgsPlotRegistry & rh)
delete

◆ plotAboutToBeRemoved

void QgsPlotRegistry::plotAboutToBeRemoved ( const QString & type)
signal

Emitted whenever a plot type is about to be remove from the registry, with the specified type and visible name.

◆ plotAdded

void QgsPlotRegistry::plotAdded ( const QString & type,
const QString & name )
signal

Emitted whenever a new plot type is added to the registry, with the specified type and visible name.

◆ plotMetadata()

QgsPlotAbstractMetadata * QgsPlotRegistry::plotMetadata ( const QString & type) const

Returns the metadata for the specified plot type.

Returns nullptr if a corresponding type was not found in the registry.

Definition at line 49 of file qgsplotregistry.cpp.

◆ plotTypes()

QMap< QString, QString > QgsPlotRegistry::plotTypes ( ) const

Returns a map of available plot types to translated name.

Definition at line 82 of file qgsplotregistry.cpp.

◆ populate()

bool QgsPlotRegistry::populate ( )

Populates the registry with standard plot types.

If called on a non-empty registry then this will have no effect and will return false.

Definition at line 37 of file qgsplotregistry.cpp.

◆ removePlotType()

bool QgsPlotRegistry::removePlotType ( const QString & type)

Removes a new a plot type from the registry.

Definition at line 64 of file qgsplotregistry.cpp.


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