tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 0 1918ee327afb
child 7 3f74d0d4af4c
--- a/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp	Fri Feb 19 23:40:16 2010 +0200
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -47,6 +47,7 @@
 #include <QtGui/QCheckBox>
 #include <QtGui/QLineEdit>
 #include <QtGui/QMenu>
+#include <QtCore/QLocale>
 
 QT_BEGIN_NAMESPACE
 
@@ -208,6 +209,26 @@
                                   .arg(f.pointSize());
 }
 
+QString QtPropertyBrowserUtils::dateFormat()
+{
+    QLocale loc;
+    return loc.dateFormat(QLocale::ShortFormat);
+}
+
+QString QtPropertyBrowserUtils::timeFormat()
+{
+    QLocale loc;
+    // ShortFormat is missing seconds on UNIX.
+    return loc.timeFormat(QLocale::LongFormat);    
+}
+
+QString QtPropertyBrowserUtils::dateTimeFormat()
+{
+    QString format = dateFormat();
+    format += QLatin1Char(' ');
+    format += timeFormat();
+    return format;
+}
 
 QtBoolEdit::QtBoolEdit(QWidget *parent) :
     QWidget(parent),