qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

Range widget's glitches with decimals when appearing multiple time in form, making wrong input too easy #50859

Closed olivierdalang closed 1 year ago

olivierdalang commented 1 year ago

What is the bug or the crash?

(similar but not the same as https://github.com/qgis/QGIS/issues/50858)

When a field using a range widget appears more than once on a form, it has a glitchy behavior with decimals making erroneous data entry very easy. The behavior is that it appends .000 as soon as you input a digit, so that when quickly typing 1.5 you actually get 1.5.000 which gets silently autocorrected to 1.000.

Ideally, it should only append those .000 after the widget looses focus. Alternatively, it should not autocorrect, and instead prevent validation of the form, like a constraint.

Steps to reproduce the issue

  1. create a scratch layer with a decimal field
  2. set the widget for that field to "range"
  3. set it's precision to 3
  4. using a drag/drop form, add it more than once in the form
  5. create a feature, in the edit form enter 1.5 and hit enter
  6. see that the actual input got corrected to 1.000

Versions

QGIS version 3.28.0-Firenze QGIS code revision ed3ad0430f3 Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.5.2 PROJ version 9.1.0 EPSG Registry database version v10.074 (2022-08-01) GEOS version 3.10.3-CAPI-1.16.1 SQLite version 3.39.4

Supported QGIS version

New profile

Additional context

No response

olivierdalang commented 1 year ago

Actually a similar glitch happens even for default text widgets, albeit slightly less silent (because the .000 gets appended right away, preventing additional input). Still quite cumbersome to use.