QGIS API Documentation 4.3.0-Master (d3b565c628d)
Loading...
Searching...
No Matches
qgsenumerationfieldformatter.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsenumerationfieldformatter.h
3 ---------------------
4 begin : July 2026
5 copyright : (C) 2026 by Stefanos Natsis
6 email : uclaros at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSENUMERATIONFIELDFORMATTER_H
16#define QGSENUMERATIONFIELDFORMATTER_H
17
18#include "qgis_core.h"
19#include "qgsfieldformatter.h"
20
34{
35 public:
40
41 QString id() const override;
42
43 QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;
44
45 QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;
46
47 QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const override;
48};
49
50#endif // QGSENUMERATIONFIELDFORMATTER_H
QgsEnumerationFieldFormatter()
Default constructor of field formatter provider supplied enumerated values.
virtual QVariant createCache(QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config) const
Create a cache for a given field.
QgsFieldFormatter()=default
virtual QString id() const =0
Returns a unique id for this field formatter.
virtual QVariant sortValue(QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value) const
If the default sort order should be overwritten for this widget, you can transform the value in here.
virtual QString representValue(QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value) const
Create a pretty String representation of the value.
Represents a vector layer which manages a vector based dataset.