[Qgis-developer] Edit UI doesn't load the field's value
Bernhard Ströbl
Bernhard.Stroebl at jena.de
Tue Dec 7 01:56:52 EST 2010
Hi Giuseppe,
I can confirm this behaviour QGIS 1.5/WinXP, data from PostGIS database.
My workaround is to have e.g. the QComboBox filled with values and
_additionally_ have a QTextLine named the same as the field in my layer
table holding the feature's current value. The QTextLine is not visible
to the user but gets changed if the user changes the choice in the
QComboBox by Qt'S Signal/Slot mechanism.
Example:
Layer provincia_polygon with field provincia_id (integer) + non-spatial
table provincia with fields id (integer) and provincia (varchar).
1) Fill QComboBox cbxProvincia with strings and ids from table
provincia. QLineEdit provincia_id gets filled automatically.
2) Set cbxProvincia's current index to the one corresponding to the
value in provincia_id.
3) Create a slot updating provincia_id with the id from cbxProvincia's
current index.
4) Connect cbxProvincia's SIGNAL "currentIndexChanged" to this slot.
all the best
Bernhard
Giuseppe Sucameli schrieb:
> Hi all,
> it seems there is a problem with Edit UI dialog.
>
> I have an .UI which contains a combobox and a spinbox.
> When I edit a row using the Edit UI dialog, the combobox PROVINCIA loads
> all the values of the PROVINCIA field, but doesn't select the current
> row value.
> The spinbox does the same, it doesn't load the current value.
>
> If I use lineedits instead, it works and loads the fields' value.
>
> Loading only doesn't work, because if I change the value and and press OK
> the dialog stores the new value back into the field.
>
> Does anybody confirm??
> Cheers.
>
> --
> Giuseppe Sucameli
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com
________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
More information about the Qgis-developer
mailing list