Hi everyone,
is there a way to put decimal comma by pressing numeric keypad dot?
Es.
123,45 -> 123 then pressing "." it puts the "," for 123,45
now with "." simply does nothing...
I searched around but I didn't find anything
Thanks in advance!
Printable View
Hi everyone,
is there a way to put decimal comma by pressing numeric keypad dot?
Es.
123,45 -> 123 then pressing "." it puts the "," for 123,45
now with "." simply does nothing...
I searched around but I didn't find anything
Thanks in advance!
The decimal point character depends to QLocale set for the Widget with QWidget::setLocale()
For "Italian" locale this is ','; for "C" locale is ".".
You can override this behaviour deriving from QDoubleSpinBox and reimplementing QWidget::keyPressEvent()
From doc:
so to have the thousand separator? (sorry, I can't understand this section... :confused: )Quote:
(QDoubleSpinBox::textFromValue()): [...]The default implementation returns a string containing value printed using QLocale().toString(value, QLatin1Char('f'), decimals()) and will remove the thousand separator.[...]
QLocale formats numbers so that it includes a thousand separator. QDoubleSpinBox just removes it because it's not sensible to include in a spin box...
Anyway, what I meant was something like this:
Code:
{ } double MyDoubleSpinBox::valueFromText(const QString& text) const { }