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!
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!
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
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()
A camel can go 14 days without drink,
I can't!!!
Raccoon29 (21st May 2008)
J-P Nurmi
From doc:
so to have the thousand separator? (sorry, I can't understand this section... )(QDoubleSpinBox::textFromValue()): [...]The default implementation returns a string containing value printed using QLocale().toString(value, QLatin1Char('f'), decimals()) and will remove the thousand separator.[...]
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
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:
Qt Code:
{ } double MyDoubleSpinBox::valueFromText(const QString& text) const { }To copy to clipboard, switch view to plain text mode
J-P Nurmi
Raccoon29 (21st May 2008)
Bookmarks