-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
raster export (save as...) not working if QGIS locale uses commas as decimal separator #41284
Comments
I think the issue is caused by the use of QDoubleValidator with QLineEdit widgets and then to use toDouble() and QString::number(), which are not Locale aware, instead of QLocate().toDouble() and QLocale().toString() or the new QgsDoubleValidator. |
Please note that the same error message is returned if the "resolution" fields are left empty (if the layer being exported is a WMS this fields are empty by default), regardless of the QGIS locale. This was not the case in the past see #29891 (comment) I suggest to not enable the "ok" button unless the resolution fields are filled. |
What doyou think it should be the expected behaviour, should the user be allowed to input either points or commas in the text widgets? |
@gioman I have created a regression test case to verify the locale comma related problems in the raster dialog: https://qgis.tenant.kiwitcms.org/case/42/ We should run those on all platforms when the fix is merged into master. |
@SrNetoChan thanks, agree! |
Fixes qgis#41284 (cherry picked from commit 10a3740)
QGIS master Ubuntu 20.04
*) in QGIS properties > general set a locale to language that uses the comma as a decimal separator (pt_PT in my case)
*) add a raster layer
*) right click the raster layer > export > save as...
*) set the export properties and try to set a HxV resolution to a decimal value > QGIS allows to enter the only the comma as a separator
*) click "ok" >
*) works ok if resolution is set to values with no decimals
I am pretty sure to have seen this (QGIS not letting use the point as a separator in case the QGIS locale uses the comma) in other parts of QGIS but I don't recall where right now.
The text was updated successfully, but these errors were encountered: