Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong step/increment in Range Widget when "Allow NULL" is selected #34394

Open
PedroVenancio opened this issue Feb 10, 2020 · 12 comments
Open

Wrong step/increment in Range Widget when "Allow NULL" is selected #34394

PedroVenancio opened this issue Feb 10, 2020 · 12 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Widgets

Comments

@PedroVenancio
Copy link
Contributor

PedroVenancio commented Feb 10, 2020

Describe the bug
The step/increment in Range Widget is wrong, when "Allow NULL" is selected. Please see the screencast:

range_widget

The "Allow NULL" option seems to have some issues: #31245

How to Reproduce

  1. Open this project: range_widget.zip

  2. Test like in the screencast.

QGIS and OS versions

QGIS version 3.10.2-A Coruña QGIS code revision 032ed31
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.1.0dev Running against GDAL/OGR 3.1.0dev
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 7.0.0 Running against PROJ Rel. 7.0.0, March 1st, 2020
OS Version Windows 10 (10.0) This copy of QGIS writes debugging output.
Active python plugins BackupLayer; DataPlotly; geoprocAlgos; getools; gml_application_schema_toolbox; go2streetview; HCMGIS; lrs; MultiDistanceBuffer; ntv2_transformations; photo2shape; pointsamplingtool; postgis_geoprocessing; PotentialSlopeFailure; processing_circuitscape; processing_gnm; processing_js; processing_prepair; processing_saga; profiletool; qchainage; Qgis2threejs; QNEAT3; quick_map_services; refFunctions; SemiAutomaticClassificationPlugin; SentinelHub; statist; SwapVectorDirection; timemanager; verifica_lotesrp; VoGisProfilTool; db_manager; MetaSearch; processing

Additional context

@PedroVenancio PedroVenancio added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 10, 2020
@alexbruy
Copy link
Contributor

Step works as expected if "Allow NULL" is unchecked.

@gioman gioman added the Feedback Waiting on the submitter for answers label May 26, 2020
@alexbruy
Copy link
Contributor

Actually it also works with "Allow NULL" checked. And this clearly visible in the screencast: each step increments by 0.5 which is a step value configured for this field. Also this can be verified by entering any value manually and then using up/down buttons to increase or decrease number.

@PedroVenancio
Copy link
Contributor Author

Hi @alexbruy

So the expected behaviour is, when Allow NULL is checked, it count also de zero ("0.0")?

For instance, if the minimum is 0 and the Allow NULL is checked and the step defined as 0.5, it counts: 0.0 ... 0.1 ... 0.2 ... 0.3 ... 0.4 ?

I can understand it, but it does not seem very intuitive, because my understanding of Allow NULL in this context was only to give the opportunity to the user to leave the field without be filled with any value.
Imagine in my use case. That field should store the air temperature (degrees celsius, ºC). If I uncheck the Allow NULL, it uses 0.0 as default, but 0.0ºC is a valid temperature value (unlike for instance precipitation), and it will break all subsequent data analysis. This makes sense?

@alexbruy
Copy link
Contributor

We don't use 0 (zero) as NULL. For NULL used special value, which in this case (if I read code correctly) is min - step. So if I understand initial issue, problem appears when widget has NULL value by default (for example new feature was digitized) and clicking on the up arrow produces wrong result.

@PedroVenancio
Copy link
Contributor Author

So if I understand initial issue, problem appears when widget has NULL value by default (for example new feature was digitized) and clicking on the up arrow produces wrong result.

Exactly @alexbruy

@gioman gioman removed the Feedback Waiting on the submitter for answers label Jun 25, 2020
@gioman gioman added the Widgets label Jan 2, 2021
@Pedro-Murteira
Copy link

Still an issue on QGIS 3.22.3.

@elpaso
Copy link
Contributor

elpaso commented Jan 21, 2022

@Pedro-Murteira you are doing an amazing job in checking all old issues!!!
Thank you!

@Pedro-Murteira
Copy link

@elpaso thank you very much! I'm glad to be helping QGIS!

@lindacamathias
Copy link

still an issue in QGIS 3.24.1

@koenigherford
Copy link

I can confirm, its still an issue in QGIS 3.34. / the connection to "Allow NULL"-checkbox is not very intuitive

Unfortunately changing the "Allow NULL"-checkbox is not allowed (greyed out) when using "Range-Slider" or "Range-Dial" instead of "Range-Editable": As a workaround you have to change to "Range-Editable", then adjust "Allow NULL"-checkbox and then change back to "Range-Slider" or "Range-Dial" -setting.

grafik

@koenigherford
Copy link

my intuitive thought was that using a slider with step "10" will allow only "0,10,20,30..."-values.

But it is sliding in "1"-steps when moving the slider-button by mouse. Only when clicking on the slider-line beneath the silder-button there are "10"-steps (but the will end up for example in 14,24,34,..., when silder is set to 4 first)

grafik

@koenigherford
Copy link

When exporting the project to QFIELD and using the slider there, the slider works als expected: Just in 10-steps by using the slider-button or by clicking on the line.

It will be nice, when QGIS will work in the same way the developers of QFIELD imagined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Widgets
Projects
None yet
Development

No branches or pull requests

7 participants