Skip to content
Permalink
Browse files

API documentation for QgsFieldFormatter caches and more

  • Loading branch information
m-kuhn committed Dec 20, 2016
1 parent 1b5e577 commit 83c58d1c6c2bd51a4a3ccae2198c864160b4d97b
Showing with 18 additions and 0 deletions.
  1. +8 −0 src/core/qgsfieldformatter.h
  2. +10 −0 src/core/qgsvectorlayer.h
@@ -79,6 +79,14 @@ class CORE_EXPORT QgsFieldFormatter
/**
* Create a cache for a given field.
*
* This will be used in situations where a field is being represented various times in a loop. And will be passed
* to other methods on QgsFieldKit and QgsEditorWidgetWrapper.
*
* For example, the attribute table will create a cache once for each field and then use this
* cache for representation. The QgsValueRelationFieldFormatter and QgsValueRelationEditorWidget
* implement this functionality to create a lookuptable once (a QVariantMap / dict) and are
* make use of a cache if present.
*
* @note Added in 3.0
*/
virtual QVariant createCache( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config ) const;
@@ -1454,7 +1454,17 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void setConstraintExpression( int index, const QString& expression, const QString& description = QString() );

/**
* \copydoc editorWidgetSetup
*/
void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup& setup );

/**
* The editor widget setup defines which QgsFieldFormatter and editor widget will be used
* for the field at `index`.
*
* @note Added in QGIS 3.0
*/
QgsEditorWidgetSetup editorWidgetSetup( int index ) const;

/** Calculates a list of unique values contained within an attribute in the layer. Note that

0 comments on commit 83c58d1

Please sign in to comment.
You can’t perform that action at this time.