summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmldatetimeformatter.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-01 01:21:44 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-01 01:21:44 (GMT)
commit1206e9fb0c9a21e60b1e6841bb3071daa1f0da8a (patch)
tree019e5bf36d8f97c487edac68381b6dcaaf3d6129 /src/declarative/util/qmldatetimeformatter.cpp
parent09be36905f81923e665743520b93a24af0ec784d (diff)
downloadQt-1206e9fb0c9a21e60b1e6841bb3071daa1f0da8a.zip
Qt-1206e9fb0c9a21e60b1e6841bb3071daa1f0da8a.tar.gz
Qt-1206e9fb0c9a21e60b1e6841bb3071daa1f0da8a.tar.bz2
More format conversion.
Diffstat (limited to 'src/declarative/util/qmldatetimeformatter.cpp')
-rw-r--r--src/declarative/util/qmldatetimeformatter.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/declarative/util/qmldatetimeformatter.cpp b/src/declarative/util/qmldatetimeformatter.cpp
index efddd81..94b87ee 100644
--- a/src/declarative/util/qmldatetimeformatter.cpp
+++ b/src/declarative/util/qmldatetimeformatter.cpp
@@ -74,8 +74,8 @@ public:
\brief The DateTimeFormatter allows you to control the format of a date string.
\code
- <DateTimeFormatter id="Formatter" date="{System.date}"/>
- <Text text="{Formatter.dateText}"/>
+ DateTimeFormatter { id: Formatter; date: System.date }
+ Text { text: Formatter.dateText }
\endcode
By default, the text properties (dateText, timeText, and dateTimeText) will return the
@@ -110,18 +110,18 @@ QmlDateTimeFormatter::~QmlDateTimeFormatter()
will use the system locale's default 'short' setting.
\code
- <!-- specify source date (assuming today is February 19, 2009) -->
- <DateTimeFormatter id="formatter" dateTime="{Today.date}"/>
+ // specify source date (assuming today is February 19, 2009)
+ DateTimeFormatter { id: formatter; dateTime: Today.date }
- <!-- display the full date and time -->
- <Text text="{formatter.dateText}"/>
+ // display the full date and time
+ Text { text: formatter.dateText }
\endcode
Would be equivalent to the following for a US English locale:
\code
- <!-- display the date -->
- <Text text="2/19/09"/>
+ // display the date
+ Text { text: "2/19/09" }
\endcode
*/
QString QmlDateTimeFormatter::dateTimeText() const
@@ -150,14 +150,14 @@ QString QmlDateTimeFormatter::timeText() const
The source date and time to be used by the formatter.
\code
- <!-- setting the date and time -->
- <DateTimeFormatter date="{System.date}" time="{System.time}"/>
+ // setting the date and time
+ DateTimeFormatter { date: System.date; time: System.time }
\endcode
For convienience it is possible to set the datetime property to set both the date and the time.
\code
- <!-- setting the datetime -->
- <DateTimeFormatter dateTime="{System.dateTime}"/>
+ // setting the datetime
+ DateTimeFormatter { dateTime: System.dateTime }
\endcode
There can only be one instance of date and time per formatter; if date, time, and dateTime are all
@@ -208,8 +208,8 @@ QDateTime QmlDateTimeFormatter::dateTime() const
Syntax for the format is based on the QDateTime::toString() formatting options.
\code
- <!-- Format the date such that the dateText is: '1997-12-12'>
- <DateFormatter id="formatter" dateTime="{Today.dateTime}" formatDate="yyyy-MM-d"/>
+ // Format the date such that the dateText is: '1997-12-12'
+ DateTimeFormatter { id: formatter; dateTime: Today.dateTime; formatDate: "yyyy-MM-d" }
\endcode
Assigning an empty string to a particular format will reset it.