summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-04 14:08:21 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-04 14:08:21 (GMT)
commit48edd0b663b29413452389c906487cc9b0408b29 (patch)
tree0b5e3e9de4c45adec46a80845ed640ee16ba46b1 /doc
parent8bc0456491e5a7e1fc677fce6e76932ab0d923e8 (diff)
parent6f09fc3a475eb2e1c843f4aebe7ea0d15182ac1d (diff)
downloadQt-48edd0b663b29413452389c906487cc9b0408b29.zip
Qt-48edd0b663b29413452389c906487cc9b0408b29.tar.gz
Qt-48edd0b663b29413452389c906487cc9b0408b29.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (100 commits) Update QML PropertyAnimation::easing docs Add testcase for QTBUG-7730 Add autotests for tab and backtab in Keys and KeyNavigation. Run signal expressions on attached property objects in correct scope Fixup test Add support for tab and backtab in KeyNavigation Mark QGraphicsItem position properties as FINAL Move the multimedia files to the correct place. Fix grammar stringifying "on" as "readonly" Improve grouped property error messages Don't mess with highlight size if highlightFollowsCurrentItem is false. Fix ListView contentHeight calculation. Remove Qt.playSound() Add formatting functions to QML's global Qt object. Signal handler requires exactly one value. QDeclarativeContext::contextProperty() should also access ids Compile without QVariant::EasingCurve in Qt 4.6.2. Documented view behavior when items are removed from start of view. Fix tests failing due to javascript eval errors. Remove unnecessary additional hash of QDeclarativeGridViewAttached ...
Diffstat (limited to 'doc')
-rw-r--r--doc/src/declarative/elements.qdoc2
-rw-r--r--doc/src/declarative/globalobject.qdoc79
-rw-r--r--doc/src/declarative/tutorial.qdoc6
3 files changed, 81 insertions, 6 deletions
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 1fd4dad..6cca39b 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -91,6 +91,7 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l VisualDataModel
\o \l Package
\o \l XmlListModel and XmlRole
+\o \l WorkerListModel
\o \l DateTimeFormatter
\o \l NumberFormatter
\endlist
@@ -102,6 +103,7 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l Component
\o \l Timer
\o \l QtObject
+\o \l WorkerScript
\endlist
\endtable
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index c718a6d..4b1c7d3 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -87,6 +87,82 @@ This function returns a Point with the specified \c x and \c y coordinates.
This function returns as Size with the specified \c width and \c height.
\section3 Qt.vector3d(real x, real y, real z)
This function returns a Vector3D with the specified \c x, \c y and \c z.
+
+\section2 Formatters
+The Qt object contains several functions for formatting dates and times.
+
+\section3 Qt.formatDate(datetime date, variant format)
+This function returns the string representation of \c date, formatted according to \c format.
+\section3 Qt.formatTime(datetime time, variant format)
+This function returns the string representation of \c time, formatted according to \c format.
+\section3 Qt.formatDateTime(datetime dateTime, variant format)
+This function returns the string representation of \c dateTime, formatted according to \c format.
+
+\c format for the above formatting functions can be specified as follows.
+
+ These expressions may be used for the date:
+
+ \table
+ \header \i Expression \i Output
+ \row \i d \i the day as number without a leading zero (1 to 31)
+ \row \i dd \i the day as number with a leading zero (01 to 31)
+ \row \i ddd
+ \i the abbreviated localized day name (e.g. 'Mon' to 'Sun').
+ Uses QDate::shortDayName().
+ \row \i dddd
+ \i the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
+ Uses QDate::longDayName().
+ \row \i M \i the month as number without a leading zero (1-12)
+ \row \i MM \i the month as number with a leading zero (01-12)
+ \row \i MMM
+ \i the abbreviated localized month name (e.g. 'Jan' to 'Dec').
+ Uses QDate::shortMonthName().
+ \row \i MMMM
+ \i the long localized month name (e.g. 'January' to 'December').
+ Uses QDate::longMonthName().
+ \row \i yy \i the year as two digit number (00-99)
+ \row \i yyyy \i the year as four digit number
+ \endtable
+
+ These expressions may be used for the time:
+
+ \table
+ \header \i Expression \i Output
+ \row \i h
+ \i the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
+ \row \i hh
+ \i the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
+ \row \i m \i the minute without a leading zero (0 to 59)
+ \row \i mm \i the minute with a leading zero (00 to 59)
+ \row \i s \i the second without a leading zero (0 to 59)
+ \row \i ss \i the second with a leading zero (00 to 59)
+ \row \i z \i the milliseconds without leading zeroes (0 to 999)
+ \row \i zzz \i the milliseconds with leading zeroes (000 to 999)
+ \row \i AP
+ \i use AM/PM display. \e AP will be replaced by either "AM" or "PM".
+ \row \i ap
+ \i use am/pm display. \e ap will be replaced by either "am" or "pm".
+ \endtable
+
+ All other input characters will be ignored. Any sequence of characters that
+ are enclosed in singlequotes will be treated as text and not be used as an
+ expression. Two consecutive singlequotes ("''") are replaced by a singlequote
+ in the output.
+
+ Example format strings (assumed that the date and time is 21 May 2001
+ 14:13:09):
+
+ \table
+ \header \i Format \i Result
+ \row \i dd.MM.yyyy \i 21.05.2001
+ \row \i ddd MMMM d yy \i Tue May 21 01
+ \row \i hh:mm:ss.zzz \i 14:13:09.042
+ \row \i h:m:s ap \i 2:13:9 pm
+ \endtable
+
+If no format is specified the locale's short format is used. Alternatively, you can specify
+\c Qt.DefaultLocaleLongDate to get the locale's long format.
+
\section2 Functions
The Qt object also contains the following miscellaneous functions which expose Qt functionality for use in QML.
@@ -119,9 +195,6 @@ while the following would rotate myItem clockwise from 350 degrees to 370 degree
NumberAnimation { target: myItem; property: "rotation"; from: 350; to: Qt.closetAngle(350, 10) }
\endqml
-\section3 Qt.playSound(url soundLocation)
-This function plays the audio file located at \c soundLocation. Only .wav files are supported.
-
\section3 Qt.openUrlExternally(url target)
This function attempts to open the specified \c target url in an external application, based on the user's desktop preferences. It will return true if it succeeds, and false otherwise.
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 98efe12..310b776 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -173,10 +173,10 @@ In this case the rectangle will have the same size as its parent (see \l{anchor-
\snippet examples/declarative/tutorials/helloworld/Cell.qml 3
-In order to change the color of the text when clicking on a cell, we create a \l MouseRegion element with
+In order to change the color of the text when clicking on a cell, we create a \l MouseArea element with
the same size as its parent.
-A \l MouseRegion defines a signal called \e clicked.
+A \l MouseArea defines a signal called \e clicked.
When this signal is triggered we want to emit our own \e clicked signal with the color as parameter.
\section2 The main QML file
@@ -214,7 +214,7 @@ Here is the QML code:
\snippet examples/declarative/tutorials/helloworld/tutorial3.qml 2
First, we create a new \e down state for our text element.
-This state will be activated when the \l MouseRegion is pressed, and deactivated when it is released.
+This state will be activated when the \l MouseArea is pressed, and deactivated when it is released.
The \e down state includes a set of property changes from our implicit \e {default state}
(the items as they were initially defined in the QML).