29 return QStringLiteral(
"ValueMap" );
36 QString valueInternalText;
40 valueInternalText = value.toString();
42 const QVariant v = config.value( QStringLiteral(
"map" ) );
43 const QVariantList list = v.toList();
46 for (
const QVariant &item : list )
48 const QVariantMap map = item.toMap();
50 for (
auto it = map.constBegin(); it != map.constEnd(); ++it )
52 if ( it.value().toString() == valueInternalText )
61 QVariantMap map = v.toMap();
62 return map.key( valueInternalText, QVariant( QStringLiteral(
"(%1)" ).arg( layer->
fields().
at( fieldIndex ).
displayString( value ) ) ).toString() );
76 const QList<QVariant> valueList = config.value( QStringLiteral(
"map" ) ).toList();
77 for (
const QVariant &item : valueList )
79 values.append( item.toMap().constBegin().value() );
80 if ( values.count() == countLimit )
A context for field formatter containing information like the project.
QString displayString(const QVariant &v) const
Formats string for display.
QgsField at(int i) const
Returns the field at particular index (must be in range 0..N-1).
Represents a vector layer which manages a vector based data sets.
QgsFields fields() const FINAL
Returns the list of fields of this layer.