[Qgis-developer] Questions about QgsEditorWidgetWrapper value() / setValue()
Even Rouault
even.rouault at spatialys.com
Fri Apr 22 07:25:41 PDT 2016
Hi Matthias,
>
> value() should return the real/raw value. Returning the display value is
> wrong.
OK, looking closer, my below comment about
QgsRelationReferenceWidgetWrapper::value() returning the displayed values was
actually wrong.
>
> > 2) Implementation of QgsRelationReferenceWidgetWrapper.
> > The value() method in that case actually returns the foreign key set by
> > setValue(). Is that intended ? To have similar behaviour as
> > QgsValueRelationWidgetWrapper, one could rather expect value() to return
> > the evaluation of the display expression, no ?
> > If the current behaviour is intended, is there something in the
> > abstraction of QgsEditorWidgetWrapper that could return the evaluation
> > of the display expression for a QgsRelationReferenceWidgetWrapper ?
>
> For this there is QgsEditorWidgetFactory::representString
> https://qgis.org/api/classQgsEditorWidgetFactory.html#a6805c62cc859478b4d47
> 15b3819ce24f
Thanks, that make sense. And it is actually implemented by
QgsRelationReferenceWidgetWrapper.
Wouldn't make it sense then for QgsRelationReferenceWidgetWrapper to implement
it and return the evaluation of the display expression ?
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the Qgis-developer
mailing list