QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
|
The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter. More...
#include <qgsfieldformatterregistry.h>
Signals | |
void | fieldFormatterAdded (QgsFieldFormatter *formatter) |
Will be emitted after a new field formatter has been added. More... | |
void | fieldFormatterRemoved (QgsFieldFormatter *formatter) |
Will be emitted just before a field formatter is removed and deleted. More... | |
Public Member Functions | |
QgsFieldFormatterRegistry (QObject *parent=nullptr) | |
You should not normally need to create your own field formatter registry. More... | |
~QgsFieldFormatterRegistry () override | |
void | addFieldFormatter (QgsFieldFormatter *formatter) |
They will take precedence in order of adding them. More... | |
QgsFieldFormatter * | fallbackFieldFormatter () const |
Returns a basic fallback field formatter which can be used to represent any field in an unspectacular manner. More... | |
QgsFieldFormatter * | fieldFormatter (const QString &id) const |
Gets a field formatter by its id. More... | |
void | removeFieldFormatter (const QString &id) |
Remove the field formatter with the specified id. More... | |
void | removeFieldFormatter (QgsFieldFormatter *formatter) |
Remove a field formatter from the registry. More... | |
The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter.
A reference to the QgsFieldFormatterRegistry can be obtained from QgsApplication::fieldFormatterRegistry().
Definition at line 40 of file qgsfieldformatterregistry.h.
|
explicit |
You should not normally need to create your own field formatter registry.
Use the one provided by QgsApplication::fieldFormatterRegistry()
instead.
Definition at line 31 of file qgsfieldformatterregistry.cpp.
|
override |
Definition at line 46 of file qgsfieldformatterregistry.cpp.
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 53 of file qgsfieldformatterregistry.cpp.
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 82 of file qgsfieldformatterregistry.cpp.
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 76 of file qgsfieldformatterregistry.cpp.
|
signal |
Will be emitted after a new field formatter has been added.
|
signal |
Will be emitted just before a field formatter is removed and deleted.
void QgsFieldFormatterRegistry::removeFieldFormatter | ( | const QString & | id | ) |
Remove the field formatter with the specified id.
Definition at line 66 of file qgsfieldformatterregistry.cpp.
void QgsFieldFormatterRegistry::removeFieldFormatter | ( | QgsFieldFormatter * | formatter | ) |
Remove a field formatter from the registry.
The field formatter will be deleted.
Definition at line 61 of file qgsfieldformatterregistry.cpp.