[QGIS-Developer] numeric values in text edit widget (forms)

thomas thomas at qgis.de
Thu Oct 22 01:30:06 PDT 2020


Hi again!

At last I am able to reproduce the weird behavior of the text edit widget with numeric values, tested and found in QGIS 3.10.9 and 3.14.1 (locale DE_de, on Windows):

Steps taken: load a (PostGIS) layer, create an attribute form with the drag and drop designer, add a numeric field (should contain values that differ from 0.0 in order to see the effect) - the default widget will already be text, add this field again (and add this field again for a third time), save the settings/form, open the form.

Surprising result: each very first use of our field displays only a 0 [zero] instead of the value. Every following use then shows the correct numeric value!

Because the recurrence of fields in my case has been spread over different tabs and groups in the form, I did not recognize this at first. But moving a second - working - use of a field to the top of the form reveald, that the display error swapped accordingly!

This however also allows for a work around: add a tab or group at the very top of the form which holds (at least) all fields, that may appear multiple times in the form and supress its visibility with an expression, that is never true.

BTW, if the widget for the numeric field is changed, e.g. to range or unique values, the described display error does not occur.

All the Best
Thomas


> Alessandro Pasotti <apasotti at gmail.com> hat am 26.09.2020 15:33 geschrieben:
> 
> 
> No worries, thanks for the update!
> 
> 
> On Sat, Sep 26, 2020, 14:23 thomas <thomas at qgis.de> wrote:
> > Hi!
> >  
> >  In order to be able to give a proper report I tested again with my tables from scratch and, guess 
> >  what, I was not able to reproduce the strange and inconsistent behavior of the form.
> >  
> >  In the end it seems like it is caused (only) by my broken qml/layer style code.
> >  
> >  During the long development history of my huge and complex form there was quite a lot of clicking 
> >  and copying style parts back and forth, between layers and possibly across versions of QGIS.... At 
> >  some time it broke without been noticed at first. - I found no way of repairing it, so will have to 
> >  rebuild the form. m(
> >  
> >  Sorry for the noise, all the best
> >  Thomas
> >  
> >  
> >  
> >  Am 24.09.20 um 12:08 schrieb Alessandro Pasotti:
> >  > On Thu, Sep 24, 2020 at 12:01 PM Thomas Schüttenberg <thomas at qgis.de> wrote:
> >  >>
> >  >> Hi!
> >  >>
> >  >> I just realized that numeric values (from a PostGIS table) are not displayed by a text edit widget in an attribute form, everything that is instead shown is 0 [zero].
> >  >>
> >  >> I switched from the default range widget to text edit widget, because I just want to show the attributes, read only, and this way it looks nicer to me. (BTW, the min/max values of the randfe widget are quite tremendous, see https://github.com/qgis/QGIS/issues/24725)
> >  >>
> >  >> To me this seems to be a bug and I suspect it to be related to localization (de_DE) issues which are themselves numerous. Therefore I wanted to check if anybody here knows an already existing/open bug report on this, because I did not find something exactly fitting. - Otherwise I will file a new one.
> >  > 
> >  > Please file a new ticket, can you also check if with en_US locale the
> >  > issue is still there?
> >  > 
> >  > 
> >  >>
> >  >> I tested on Windows with QGIS 3.4.12, 3.10.9 and 3.14.1.
> >  >>
> >  >> Cheers
> >  >> Thomas
> >  >> _______________________________________________
> >  >> QGIS-Developer mailing list
> >  >> QGIS-Developer at lists.osgeo.org
> >  >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >  >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >  > 
> >  > 
> >  > 
> >


More information about the QGIS-Developer mailing list