QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsFieldFormatterRegistry Class Reference

The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter. More...

#include <qgsfieldformatterregistry.h>

Inheritance diagram for QgsFieldFormatterRegistry:
Inheritance graph
[legend]

Signals

void fieldFormatterAdded (QgsFieldFormatter *formatter)
 Will be emitted after a new field formatter has been added.
 
void fieldFormatterRemoved (QgsFieldFormatter *formatter)
 Will be emitted just before a field formatter is removed and deleted.
 

Public Member Functions

 QgsFieldFormatterRegistry (QObject *parent=nullptr)
 You should not normally need to create your own field formatter registry.
 
 ~QgsFieldFormatterRegistry () override
 
void addFieldFormatter (QgsFieldFormatter *formatter)
 They will take precedence in order of adding them.
 
QgsFieldFormatterfallbackFieldFormatter () const
 Returns a basic fallback field formatter which can be used to represent any field in an unspectacular manner.
 
QgsFieldFormatterfieldFormatter (const QString &id) const
 Gets a field formatter by its id.
 
void removeFieldFormatter (const QString &id)
 Remove the field formatter with the specified id.
 
void removeFieldFormatter (QgsFieldFormatter *formatter)
 Remove a field formatter from the registry.
 

Detailed Description

The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter.

A reference to the QgsFieldFormatterRegistry can be obtained from QgsApplication::fieldFormatterRegistry().

Definition at line 39 of file qgsfieldformatterregistry.h.

Constructor & Destructor Documentation

◆ QgsFieldFormatterRegistry()

QgsFieldFormatterRegistry::QgsFieldFormatterRegistry ( QObject *  parent = nullptr)
explicit

You should not normally need to create your own field formatter registry.

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

Definition at line 32 of file qgsfieldformatterregistry.cpp.

◆ ~QgsFieldFormatterRegistry()

QgsFieldFormatterRegistry::~QgsFieldFormatterRegistry ( )
override

Definition at line 47 of file qgsfieldformatterregistry.cpp.

Member Function Documentation

◆ addFieldFormatter()

void QgsFieldFormatterRegistry::addFieldFormatter ( QgsFieldFormatter formatter)

They will take precedence in order of adding them.

The later they are added, the more weight they have.

Ownership is transferred to the registry.

Definition at line 54 of file qgsfieldformatterregistry.cpp.

◆ fallbackFieldFormatter()

QgsFieldFormatter * QgsFieldFormatterRegistry::fallbackFieldFormatter ( ) const

Returns a basic fallback field formatter which can be used to represent any field in an unspectacular manner.

Definition at line 83 of file qgsfieldformatterregistry.cpp.

◆ fieldFormatter()

QgsFieldFormatter * QgsFieldFormatterRegistry::fieldFormatter ( const QString &  id) const

Gets a field formatter by its id.

If there is no such id registered, a default QgsFallbackFieldFormatter with a null id will be returned instead.

Definition at line 77 of file qgsfieldformatterregistry.cpp.

◆ fieldFormatterAdded

void QgsFieldFormatterRegistry::fieldFormatterAdded ( QgsFieldFormatter formatter)
signal

Will be emitted after a new field formatter has been added.

◆ fieldFormatterRemoved

void QgsFieldFormatterRegistry::fieldFormatterRemoved ( QgsFieldFormatter formatter)
signal

Will be emitted just before a field formatter is removed and deleted.

◆ removeFieldFormatter() [1/2]

void QgsFieldFormatterRegistry::removeFieldFormatter ( const QString &  id)

Remove the field formatter with the specified id.

Definition at line 67 of file qgsfieldformatterregistry.cpp.

◆ removeFieldFormatter() [2/2]

void QgsFieldFormatterRegistry::removeFieldFormatter ( QgsFieldFormatter formatter)

Remove a field formatter from the registry.

The field formatter will be deleted.

Definition at line 62 of file qgsfieldformatterregistry.cpp.


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