Shouldn't the period/comma depend on the locale? Many countries use commas as the decimal mark.
It should, but it doesn't, besides accepting a comma as a decimal mark when entering values by hand:
if (keyEvent->key() == Qt::Key_Comma)
{
// Translate a comma into a period
QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count());
QApplication::sendEvent(object, &periodKeyEvent);
return true;
}