[Qgis-developer] Edit UI doesn't load the field's value
Bernhard Ströbl
Bernhard.Stroebl at jena.de
Wed Dec 8 02:36:01 EST 2010
Dear Giuseppe,
no, I did not file a ticket for this, although I would support doing so.
If I customize the default edit-ui via "Layer Properties" - "Attributes"
and choose a "value map" for a numerical field the resulting ComboBox
shows the Strings I define but saves the values to the layer's table. I
had expected the same behaviour with a custom ui but nope.
Giuseppe Sucameli schrieb:
> Hi Bernhard,
>
> On Tue, Dec 7, 2010 at 7:56 AM, Bernhard Ströbl
> <Bernhard.Stroebl at jena.de <mailto:Bernhard.Stroebl at jena.de>> wrote:
>
> I can confirm this behaviour QGIS 1.5/WinXP, data from PostGIS
> database.
>
> Did you file a ticket yet?
>
> 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.
>
> You're right, I understand that a developer can use the initFunction and
> editForm
> from API to bypass the issue, but how can users do the same?
I do not think they can right now. They would need to do some Python
scripting, a very good descrtiption is here:
http://www.osgeo.org/pipermail/qgis-developer/2010-January/008731.html
regards
Bernhard
>
> Thinking like an user, if I sets the edit UI from the layer property
> dialog, the obvious
> behaviour is that each combo must be populated and it must show the
> right value
> as the lineedit does.
>
> If the combobox (but also the spinbox) doesn't show the right value,
> then it's a bug.
> Maybe did I start a thread on the wrong ML? Maybe I did.
> But I hope we'll fix it quickly :)
>
> Let me know if there's a opened ticket, otherwise I file a new one.
> Thanks, and best regard.
>
> 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
> <mailto: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
>
>
>
>
> --
> 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