aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-19 15:50:28 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-09-19 15:50:28 +0200
commit715d0b474b23bc230319c33eb7316af23b5fccaa (patch)
treeffd714454ce559433551632ffaaee1a21d8fd0a3 /src/qml/doc
parent607f2db351edf4b0f677c302fa37733596abe024 (diff)
parent52eb21be3dd3a76d018b5b86a8d72d68accb924a (diff)
Merge branch 'stable' into dev
Conflicts: src/qml/qml/v8/qqmlbuiltinfunctions.cpp tests/auto/qml/qml.pro Change-Id: Ib373aed6a8f8df9521740fb5b080daed38546cd2
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/cppintegration/contextproperties.qdoc14
-rw-r--r--src/qml/doc/src/javascript/date.qdoc106
-rw-r--r--src/qml/doc/src/javascript/number.qdoc2
3 files changed, 108 insertions, 14 deletions
diff --git a/src/qml/doc/src/cppintegration/contextproperties.qdoc b/src/qml/doc/src/cppintegration/contextproperties.qdoc
index 1c2bced738..e0d5091f2f 100644
--- a/src/qml/doc/src/cppintegration/contextproperties.qdoc
+++ b/src/qml/doc/src/cppintegration/contextproperties.qdoc
@@ -84,11 +84,15 @@ a \l Connections object:
\snippet qml/qtbinding/context-advanced/connections.qml 0
Context properties can be useful for using C++ based data models in a QML view. See the
-\l {quick/modelviews/stringlistmodel}{String ListModel},
-\l {quick/modelviews/objectlistmodel}{Object ListModel} and
-\l {quick/modelviews/abstractitemmodel}{AbstractItemModel} models for
-respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel
-in QML views.
+following examples:
+\list
+ \li \l {Models and Views: String ListModel Example}{String ListModel}
+ \li \l {Models and Views: Object ListModel Example}{Object ListModel}
+ \li \l {Models and Views: AbstractItemModel Example}{AbstractItemModel}
+\endlist
+
+demonstrating the use of QStringList, \l{QList<QObject*>}-based models and
+QAbstractItemModel in QML views.
Also see the QQmlContext documentation for more information.
diff --git a/src/qml/doc/src/javascript/date.qdoc b/src/qml/doc/src/javascript/date.qdoc
index 085d988377..89dc464adb 100644
--- a/src/qml/doc/src/javascript/date.qdoc
+++ b/src/qml/doc/src/javascript/date.qdoc
@@ -132,17 +132,18 @@
hour, if DST is currently in effect, while it was not for the time specified, or
vice versa.
- \sa {QtQuick2::Locale}{Locale}
+ \sa {QtQml2::Locale}{Locale}
*/
/*!
- \qmlmethod string Date::toLocaleString(locale,format)
+ \qmlmethod string Date::toLocaleString(locale, format)
Converts the Date to a string containing the date and time
suitable for the specified \a locale
in the specified \a format.
- If the format is not specified Locale.LongFormat will be used.
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
If \a locale is not specified, the default locale will be used.
@@ -158,12 +159,13 @@
*/
/*!
- \qmlmethod string Date::toLocaleDateString(locale,format)
+ \qmlmethod string Date::toLocaleDateString(locale, format)
Converts the Date to a string containing the date suitable for the specified \a locale
in the specified \a format.
- If the format is not specified Locale.LongFormat will be used.
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
If \a locale is not specified, the default locale will be used.
@@ -179,12 +181,13 @@
*/
/*!
- \qmlmethod string Date::toLocaleTimeString(locale,format)
+ \qmlmethod string Date::toLocaleTimeString(locale, format)
Converts the Date to a string containing the time suitable for the specified \a locale
in the specified \a format.
- If the format is not specified Locale.LongFormat will be used.
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
If \a locale is not specified, the default locale will be used.
@@ -200,10 +203,97 @@
*/
/*!
+ \qmlmethod string Date::fromLocaleString(locale, dateTimeString, format)
+
+ Converts the datetime string \a dateTimeString to a \l {QtQml2::Date}{Date}
+ object using \a locale and \a format.
+
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
+
+ If \a locale is not specified, the default locale will be used.
+
+ The following example shows a datetime being parsed from a datetime string
+ in a certain format using the default locale:
+ \code
+ import QtQml 2.0
+
+ QtObject {
+ property var locale: Qt.locale()
+ property string dateTimeString: "Tue 2013-09-17 10:56:06"
+
+ Component.onCompleted: {
+ print(Date.fromLocaleString(locale, dateTimeString, "ddd yyyy-MM-dd hh:mm:ss"));
+ }
+ }
+ \endcode
+*/
+
+/*!
+ \qmlmethod string Date::fromLocaleDateString(locale, dateString, format)
+
+ Converts the date string \a dateString to a \l {QtQml2::Date}{Date} object
+ using \a locale and \a format.
+
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
+
+ If \a locale is not specified, the default locale will be used.
+
+ The following example shows the current date first being formatted as a date
+ string using the default locale and format, then parsed back again in the
+ same manner:
+ \code
+ import QtQml 2.0
+
+ QtObject {
+ property var locale: Qt.locale()
+ property date currentDate: new Date()
+ property string dateString
+
+ Component.onCompleted: {
+ dateString = currentDate.toLocaleDateString();
+ print(Date.fromLocaleDateString(dateString));
+ }
+ }
+ \endcode
+*/
+
+/*!
+ \qmlmethod string Date::fromLocaleTimeString(locale, timeString, format)
+
+ Converts the time string \a timeString to a \l {QtQml2::Date}{Date} object
+ using \a locale and \a format.
+
+ If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will
+ be used.
+
+ If \a locale is not specified, the default locale will be used.
+
+ The following example shows the current time first being formatted as a time
+ string using the default locale and a short format, then parsed back again
+ in the same manner:
+ \code
+ import QtQuick 2.0
+
+ QtObject {
+ property var locale: Qt.locale()
+ property date currentTime: new Date()
+ property string timeString
+
+ Component.onCompleted: {
+ timeString = currentTime.toLocaleTimeString(locale, Locale.ShortFormat);
+ print(Date.fromLocaleTimeString(locale, timeString, Locale.ShortFormat));
+ }
+ }
+ \endcode
+*/
+
+/*!
\qmlmethod string Date::timeZoneUpdated()
Informs the JS engine that the system's timezone has been changed, which is necessary
- for the correct manipulation of date/time data.
+ for the correct manipulation of datetime data.
JS stores Date objects in UTC time; all access to and from Date components in local
time involves the application of the current offset from UTC. If the current offset
diff --git a/src/qml/doc/src/javascript/number.qdoc b/src/qml/doc/src/javascript/number.qdoc
index 20fe40c86f..fa56f71925 100644
--- a/src/qml/doc/src/javascript/number.qdoc
+++ b/src/qml/doc/src/javascript/number.qdoc
@@ -33,7 +33,7 @@
The QML Number object extends the JS Number object with
locale aware functions.
- \sa {QtQuick2::Locale}{Locale}
+ \sa {QtQml2::Locale}{Locale}
*/
/*!