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:
QString MyDoubleSpinBox
::textFromValue(double value
) const {
}
double MyDoubleSpinBox::valueFromText(const QString& text) const
{
}
QString MyDoubleSpinBox::textFromValue(double value) const
{
QString text = QDoubleSpinBox::textFromValue(value);
return text.replace(QLocale().decimalPoint(), QLatin1Char('.'));
}
double MyDoubleSpinBox::valueFromText(const QString& text) const
{
return QDoubleSpinBox(QString(text).replace(QLatin1Char('.'), QLocale().decimalPoint()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks