Skip to content

Commit

Permalink
Value map widget: properly represent value
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 20, 2014
1 parent 2a6488e commit 0305796
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/editorwidgets/qgsvaluemapwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ void QgsValueMapWidgetFactory::writeConfig( const QgsEditorWidgetConfig& config,
++it;
}
}

QString QgsValueMapWidgetFactory::representValue( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( vl )
Q_UNUSED( fieldIdx )
Q_UNUSED( cache )

return config.key( value, QVariant( QString( "(%1)" ).arg( value.toString() ) ).toString() );
}
1 change: 1 addition & 0 deletions src/gui/editorwidgets/qgsvaluemapwidgetfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class GUI_EXPORT QgsValueMapWidgetFactory : public QgsEditorWidgetFactory
QgsEditorConfigWidget* configWidget( QgsVectorLayer* vl, int fieldIdx, QWidget* parent ) const;
QgsEditorWidgetConfig readConfig( const QDomElement& configElement, QgsVectorLayer* layer, int fieldIdx );
void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx );
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value ) const;
};

#endif // QGSVALUEMAPWIDGETFACTORY_H

0 comments on commit 0305796

Please sign in to comment.