Solved This funny decimal point...
-
@aha_1980 said in This funny decimal point...:
Try QLocale::toDouble() instead.
Oh, my... This is not even a static function...
But what if I want show digital keyboard with "." button?
-
@Gourmet said in This funny decimal point...:
@aha_1980 said in This funny decimal point...:
Try QLocale::toDouble() instead.
Oh, my... This is not even a static function...
Yeah, but it works :)
But what if I want show digital keyboard with "." button?
Sorry, out of scope for me
-
@aha_1980 said in This funny decimal point...:
Yeah, but it works :)
Yeah! But it CREATES TWO DECIMAL POINTS TOO!!! Other app part uses QML to draw values in ListView.
text: modelData.Value
In it the "." appears again!
-
Hi,
Out of curiosity, why not use a QDoubleSpinBox ?
-
@SGaist said in This funny decimal point...:
Hi,
Out of curiosity, why not use a QDoubleSpinBox ?Did you try use standard Qt controls on Android screen? They are useless. The standard spin box is VERY uncomfortable on small smartphone screen. Therefore I will need write my own decorated spinbox with large buttons. This is not needed and time wasting. And I am not sure if QDoubleSpinBox won't show virtual digital keyboard with "." and... ignore this button.
For me it would be absolutely enough allow enter "." in QLineEdit with real validator. And not only for me. In my country about 80% people use "." for decimal point. Everywhere. I do not know who invented ","... This was stupid solution.
-
@Gourmet said in This funny decimal point...:
Did you try use standard Qt controls on Android screen? They are useless. The standard spin box is VERY uncomfortable on small smartphone screen. Therefore I will need write my own decorated spinbox with large buttons. This is not needed and time wasting. And I am not sure if QDoubleSpinBox won't show virtual digital keyboard with "." and... ignore this button.
I overlooked the Android part. Did you consider using QtQuick.Controls ? They might suite your needs better and allow you to get your GUI working on Android faster.
@Gourmet said in This funny decimal point...:
For me it would be absolutely enough allow enter "." in QLineEdit with real validator. And not only for me. In my country about 80% people use "." for decimal point. Everywhere. I do not know who invented ","... This was stupid solution.
Locales existed way before computers were even the glimpse of an idea.
-
@SGaist said in This funny decimal point...:
Did you consider using QtQuick.Controls ?
I use QtQuick for other interface part - for scrolling history list of this line edit. But this list build logic is little complex and is not suitable for QML. Or better say - on C++ it is implemented easier. I confess following religion - QML/QtQuick only for views, but Qt/C++ for models and business logic. Therefore QLineEdit is most suitable solution. It works fine. But how force validator pass "." instead of "," in this edit only?
-
@Gourmet said in This funny decimal point...:
I tried use
realvalidator->setLocale(QLocale(QLocale::Arabic));
but this... prohibits input both "," and "."
This sounds very strange.
Does this also happen on your development computer? Or does it only happen on your Android device?
-
@JKSH said in This funny decimal point...:
Does this also happen on your development computer? Or does it only happen on your Android device?
The same behavior is on Android and Linux Kubuntu development station. Probably this should be done by some other manner. But I do not see docs or examples.
-
@JKSH said in This funny decimal point...:
realvalidator->setLocale(QLocale(QLocale::Arabic));
realvalidator->setLocale(QLocale(QLocale::English));
works with ".". Do Arabic numbers not include decimal points?...
-
@Gourmet
google says, Arabic decimal point is U+066B whereas the rest of the world uses U+2396 and they have a different separator for thousandshttps://en.wikipedia.org/wiki/Decimal_separator#Other_numeral_systems