[Qgis-developer] Access to the value in a Relation reference wiget

Matthias Kuhn matthias at opengis.ch
Tue Apr 7 08:52:15 PDT 2015


You try get a QgsRelationReferenceWidget (in qgis.gui) (not sure though
if specifying this explicitly makes any difference in python though, it
should determine the real type anyway).

The methods you are looking for are then

setForeignKey()
http://qgis.org/api/classQgsRelationReferenceWidget.html#a2e9fb74545d2bb4b697a88ca4e434600

and

foreignKey()
http://qgis.org/api/classQgsRelationReferenceWidget.html#af1765af438f3dd4e642334a338a03ca4

Best,
Matthias

On 04/07/2015 10:47 AM, Enrico Fiore wrote:
> Hi,
> I am trying to acces to the value stored in a field defined as
> Relation Reference widget, I tried this code:
>
>     dialog.findChild(QWidget,"fk_via_cod")
>
> so I access to the object but not to the value.
>
> I need to do something like this
>      nameFieldDir = dialog.findChild(QLineEdit,"cod_direzione")
>
> How I can perform this?
>
> Regards
>
> Enrico Fiore
>
>
>
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150407/e1a7b4c5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150407/e1a7b4c5/attachment.pgp>


More information about the Qgis-developer mailing list