I'm afraid this is not possible to do within designer unless you're happy with setting an input mask. In code, you could catch focus out event and and apply a localized number when appropriate, for example like this:
// MyLineEdit inherits QLineEdit and reimplements QWidget::focusOutEvent()
{
bool ok = false;
double real = text().toDouble(&ok);
if (ok)
}
// MyLineEdit inherits QLineEdit and reimplements QWidget::focusOutEvent()
void MyLineEdit::focusOutEvent(QFocusEvent* event)
{
QLineEdit::focusOutEvent(event);
bool ok = false;
double real = text().toDouble(&ok);
if (ok)
setText(QLocale(QLocale::English).toString(real, 'f', 2));
}
To copy to clipboard, switch view to plain text mode
Bookmarks