aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qmltypereference.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/doc/src/qmltypereference.qdoc')
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc111
1 files changed, 18 insertions, 93 deletions
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 799945fa37..3def3209cc 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -24,20 +24,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
/*!
\qmlmodule QtQml 2
\title Qt QML QML Types
\ingroup qmlmodules
\brief List of QML types provided by the Qt QML module
-The \c QtQml module provides the definition and implementation of various
+The \l{Qt QML} module provides the definition and implementation of various
convenience types which can be used with the QML language, including some
elementary QML types which can provide the basis for further extensions to the
-QML language.
-
-The \c QtQml module provides the \c QtObject and \c Component object types
-which may be used in QML documents. These types are non-visual and provide
-building-blocks for extensions to QML.
+QML language. The \l QtObject and \l Component object types are non-visual and
+provide building-blocks for extensions to QML.
\section1 Importing QtQml
@@ -53,15 +51,20 @@ import QtQml 2.0
\endqml
Most clients will never need to use the \c QtQml import, as all of the types
-and functionality provided by the \c QtQml namespace are also provided by the
-\c QtQuick namespace which may be imported as follows:
+are also provided by the \c QtQuick namespace which may be imported as
+follows:
\qml
import QtQuick 2.0
\endqml
-See the \l{Qt Quick} module documentation for more information about the
-\c QtQuick namespace and what it provides to QML application developers.
+See the \l{Qt Quick} module documentation for more information about the \c
+QtQuick namespace and what it provides to QML application developers.
+
+The QML types for creating lists and models, such as \l ListModel and \l
+ListElement, are moved to a submodule, \c QtQml.Models. The \l{Qt QML Models QML
+Types}{Qt QML Models} page has more information.
+
The documentation for the types below applies equally to the types of the same
name provided by the \l{Qt Quick} module, as they are in fact identical.
@@ -78,82 +81,6 @@ provided:
The following \l{qtqml-typesystem-objecttypes.html}{QML object types} are
provided:
-\section2 QtObject
-
-The \c QtObject type provides a basic instantiable object which can be used in
-QML applications. It is non-visual, but may have properties, methods, signals
-and signal handlers.
-
-For example, the following QtObject has several properties, one of which has
-been assigned a \l{Property Binding}
-{binding}, and a \l{Signal and Handler Event System}{signal handler} for
-the default change signal which exists for one of its properties:
-
-\code
- import QtQuick 2.0
-
- QtObject {
- property int a: 15
- property int b: a + 22
- property int changeCount: 0
-
- onAChanged: {
- changeCount += 1;
- }
- }
-\endcode
-
-\section2 Component
-
-The \c Component type provides a basic re-usable component which allows
-instances of another type to be instantiated on-demand. It may be given an
-\c id and it has a default property which is the object type to instantiate,
-but no other properties may be added to it.
-
-For example, the following QtObject has two different \l Component
-properties, and it uses those components to dynamically construct objects at
-run-time:
-
-\code
- import QtQuick 2.0
-
- QtObject {
- id: root
- property bool which: true
-
- property Component a: Component {
- id: firstComponent
- QtObject {
- property int answer: 42
- function activate() {
- console.log("The answer is: " + answer);
- }
- }
- }
-
- property Component b: Component {
- id: secondComponent
- QtObject {
- property string message: "Hello, World!"
- function activate() {
- console.log(message);
- }
- }
- }
-
- function activateDynamicObject() {
- var o = {};
- if (which) {
- which = false;
- o = a.createObject(null); // no parent
- } else {
- which = true;
- o = b.createObject(null); // no parent
- }
- o.activate();
- }
- }
-\endcode
*/
/*!
@@ -171,7 +98,7 @@ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
\endqml
To read a date value returned from a C++ extension class, use
-\l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatDate()}{Qt.formatDate()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
When integrating with C++, note that any QDate value
\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
@@ -202,7 +129,7 @@ MyTimePicker { time: "14:22:15" }
\endqml
To read a time value returned from a C++ extension class, use
-\l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatTime()}{Qt.formatTime()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
Note that when converting historical times to and from javascript that QDateTime and the JS Date object
have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
@@ -231,7 +158,7 @@ To create a \c point value, specify it as a "x,y" string:
CustomObject { myPointProperty: "0,20" }
\endqml
-Or use the \l{QML:Qt::point()}{Qt.point()} function:
+Or use the \l{QtQml2::Qt::point()}{Qt.point()} function:
\qml
CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -269,7 +196,7 @@ To create a \c size value, specify it as a "width x height" string:
Image { sourceSize: "150x50" }
\endqml
-Or use the \l{QML:Qt::size()}{Qt.size()} function:
+Or use the \l{QtQml2::Qt::size()}{Qt.size()} function:
\qml
Image { sourceSize: Qt.size(150, 50) }
@@ -309,7 +236,7 @@ To create a \c rect value, specify it as a "x, y, width x height" string:
CustomObject { myRectProperty: "50,50,100x100" }
\endqml
-Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
+Or use the \l{QtQml2::Qt::rect()}{Qt.rect()} function:
\qml
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
@@ -322,5 +249,3 @@ is automatically converted into a QRectF value.
\sa{QML Basic Types}
*/
-
-