2017-05-23 14:35:48 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/fieldformatter/qgsvaluerelationfieldformatter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-06 14:20:21 +01:00
|
|
|
class QgsValueRelationFieldFormatter : QgsFieldFormatter
|
2016-12-04 17:23:37 +01:00
|
|
|
{
|
2017-05-23 14:35:48 +02:00
|
|
|
%Docstring
|
|
|
|
Field formatter for a value relation field.
|
|
|
|
A value relation field formatter looks up the values from
|
|
|
|
features on another layer.
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2016-12-04 17:23:37 +01:00
|
|
|
%TypeHeaderCode
|
2016-12-06 14:20:21 +01:00
|
|
|
#include "qgsvaluerelationfieldformatter.h"
|
2016-12-04 17:23:37 +01:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
struct ValueRelationItem
|
|
|
|
{
|
2017-05-01 18:13:15 +02:00
|
|
|
ValueRelationItem( const QVariant &key, const QString &value );
|
2016-12-04 17:23:37 +01:00
|
|
|
|
|
|
|
ValueRelationItem();
|
|
|
|
|
|
|
|
QVariant key;
|
|
|
|
QString value;
|
|
|
|
};
|
|
|
|
|
2016-12-06 14:20:21 +01:00
|
|
|
typedef QVector < QgsValueRelationFieldFormatter::ValueRelationItem > ValueRelationCache;
|
2016-12-04 17:23:37 +01:00
|
|
|
|
2016-12-06 14:20:21 +01:00
|
|
|
QgsValueRelationFieldFormatter();
|
2016-12-04 17:23:37 +01:00
|
|
|
|
2017-05-23 14:35:48 +02:00
|
|
|
virtual QString id() const;
|
|
|
|
|
|
|
|
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
|
2016-12-04 17:23:37 +01:00
|
|
|
|
|
|
|
|
2017-05-23 14:35:48 +02:00
|
|
|
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const;
|
|
|
|
|
2016-12-04 17:23:37 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
static QgsValueRelationFieldFormatter::ValueRelationCache createCache( const QVariantMap &config );
|
2017-05-23 14:35:48 +02:00
|
|
|
%Docstring
|
|
|
|
Create a cache for a value relation field.
|
|
|
|
This can be used to keep the value map in the local memory
|
|
|
|
if doing multiple lookups in a loop.
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsValueRelationFieldFormatter.ValueRelationCache
|
|
|
|
%End
|
2016-12-04 17:23:37 +01:00
|
|
|
};
|
2017-05-23 14:35:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/fieldformatter/qgsvaluerelationfieldformatter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|