From f1437da8cd6916651008d18393fb2190add915a6 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 12 Sep 2011 15:18:31 +1000 Subject: [PATCH] Preferences DOB QDateEdit locale fix --- preferencesdialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index 999dd381..7fcd5c11 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -101,6 +101,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : row++; } } + QLocale locale=QLocale::system(); + QString shortformat=locale.dateFormat(QLocale::ShortFormat); + if (!shortformat.toLower().contains("yyyy")) { + shortformat.replace("yy","yyyy"); + } + ui->dobEdit->setDisplayFormat(shortformat); + ui->profileTab->setTabOrder(ui->firstNameEdit,ui->lastNameEdit); ui->profileTab->setTabOrder(ui->lastNameEdit,ui->addressEdit); ui->profileTab->setTabOrder(ui->addressEdit,ui->genderMale);