-
-
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
Fix decimal point issues on raster properties forms, Fixes #33859 #37136
Fix decimal point issues on raster properties forms, Fixes #33859 #37136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please:
- add a cpp implementation file
- tests with group separator and C locale fallback
- in the new header file: class doxygen documentation for the class and for the methods
a52df08
to
4bc4e2b
Compare
… properties form QgsDoubleValidator modification after review update doc
4bc4e2b
to
893bfff
Compare
@elpaso @nyalldawson thanks for your reviews ! i'm way more satisfy to this PR with your advices. |
Too risky for 3.14.0 -- deferred |
e2ec46f
to
cbebe29
Compare
Yes, this is what I wanted to say by writing |
cbebe29
to
bfba394
Compare
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
@SebastienPeillet can you please make the requested changes so that we can finally merge? |
bfba394
to
fd6dcee
Compare
@elpaso It's done, sorry I didn't see the remained requested changes before (hidden in the conversation by default). Thanks for the reminder ! |
src/gui/qgsdoublevalidator.h
Outdated
/** | ||
* Constructor for QgsDoubleValidator. | ||
* | ||
* bottom is the minimal range limit accepted by the validator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* bottom is the minimal range limit accepted by the validator | |
* \param bottom the minimal range limit accepted by the validator |
can you please use the \param
syntax for arguments? (here and everywhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad... I add it !
src/gui/qgsdoublevalidator.h
Outdated
QValidator::State validate( QString &input, int & ) const override SIP_SKIP; | ||
|
||
/** | ||
* Evaluates input QString validity according to QRegularExpression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Evaluates input QString validity according to QRegularExpression | |
* Evaluates \a input string validity according to QRegularExpression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and all other occurrences too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done ! To avoid new corrections on this next time, is there a tacit rule for italic in documentation, can't find reference of it in Qgis coding standard ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about italic, it's for "Use this command to refer to member arguments in the running text." instead of using \param
you can use \a
for an inline description of the argument.
fd6dcee
to
887d544
Compare
Description
Issue explained and discussed here : #33859
QGIS use QDoubleValidator on QLineEdit in several forms, including raster layer forms.
As QValidator is initialized with the current locale, the expected decimal point is determined by the locale.
For exemple in french, it' is a comma and not a point.
Sometimes the string value is converted to double value, but not with the QLocale().toDouble() method. In this case the string value can't be converted.
I fixed the bug on raster properties form (but I expect it exists in some other form). The affected QLineEdit are :
I also fixed values display in the same forms plus palette form
To fix it , I create a new validator, called QgsDoubleValidator (as the Qgslonglongvalidator) using the same principle that use QgsFieldValidator for double type.
The regular expression allows to use the point and the locale decimal point as decimal point
Futhermore a static method toDouble is created to convert the string to double whatever if it is the point or the locale decimal point that is used.
I started as I will fix a bug, but now maybe it's more a feature...