|
| 1 | +/*************************************************************************** |
| 2 | + qgsvaluerelationfieldkit.sip - QgsValueRelationFieldKit |
| 3 | + |
| 4 | + --------------------- |
| 5 | + begin : 3.12.2016 |
| 6 | + copyright : (C) 2016 by Matthias Kuhn |
| 7 | + email : matthias@opengis.ch |
| 8 | + *************************************************************************** |
| 9 | + * * |
| 10 | + * This program is free software; you can redistribute it and/or modify * |
| 11 | + * it under the terms of the GNU General Public License as published by * |
| 12 | + * the Free Software Foundation; either version 2 of the License, or * |
| 13 | + * (at your option) any later version. * |
| 14 | + * * |
| 15 | + ***************************************************************************/ |
| 16 | +class QgsValueRelationFieldKit : QgsFieldKit |
| 17 | +{ |
| 18 | +%TypeHeaderCode |
| 19 | +#include "qgsvaluerelationfieldkit" |
| 20 | +%End |
| 21 | + |
| 22 | + public: |
| 23 | + struct ValueRelationItem |
| 24 | + { |
| 25 | + ValueRelationItem( const QVariant& key, const QString& value ); |
| 26 | + |
| 27 | + ValueRelationItem(); |
| 28 | + |
| 29 | + QVariant key; |
| 30 | + QString value; |
| 31 | + }; |
| 32 | + |
| 33 | + typedef QVector < ValueRelationItem > ValueRelationCache; |
| 34 | + |
| 35 | + QgsValueRelationFieldKit(); |
| 36 | + |
| 37 | + QString id() const; |
| 38 | + QString representValue( QgsVectorLayer *layer, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const; |
| 39 | + |
| 40 | + QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const; |
| 41 | + |
| 42 | + QVariant createCache( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config ) const; |
| 43 | + |
| 44 | + static ValueRelationCache createCache( const QVariantMap& config ); |
| 45 | +}; |
0 commit comments