Commit ad5ae0d7 authored by Topi Reinio's avatar Topi Reinio Committed by The Qt Project
Browse files

Doc: Move example docs related to QtQml under the correct module


This change moves 'Extending QML' qdoc file and the tutorials
from examples/quick to examples/qml, which is the correct
location for them.

Change-Id: I24bd9dfa75baaab7bc8efe08489f09a7b65d98a6
Reviewed-by: default avatarJerome Pasion <jerome.pasion@digia.com>
Reviewed-by: default avatarSze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: default avatarAlan Alpert <aalpert@blackberry.com>
parent ddfa42c8
dev 5.10 5.11 5.12 5.12.1 5.12.10 5.12.11 5.12.12 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.13 5.13.0 5.13.1 5.13.2 5.14 5.14.0 5.14.1 5.14.2 5.15 5.15.0 5.15.1 5.15.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.9.8 6.0 6.0.0 6.1 6.1.0 6.1.1 6.1.2 6.1.3 6.2 6.2.0 6.2.1 6.2.2 old/5.1 old/5.2 wip/cmake wip/dbus wip/gc wip/itemviews wip/nacl wip/new-backend wip/pointerhandler wip/propertycache-refactor wip/qquickdeliveryagent wip/scenegraphng wip/tizen wip/webassembly v5.15.0-alpha1 v5.14.1 v5.14.0 v5.14.0-rc2 v5.14.0-rc1 v5.14.0-beta3 v5.14.0-beta2 v5.14.0-beta1 v5.14.0-alpha1 v5.13.2 v5.13.1 v5.13.0 v5.13.0-rc3 v5.13.0-rc2 v5.13.0-rc1 v5.13.0-beta4 v5.13.0-beta3 v5.13.0-beta2 v5.13.0-beta1 v5.13.0-alpha1 v5.12.7 v5.12.6 v5.12.5 v5.12.4 v5.12.3 v5.12.2 v5.12.1 v5.12.0 v5.12.0-rc2 v5.12.0-rc1 v5.12.0-beta4 v5.12.0-beta3 v5.12.0-beta2 v5.12.0-beta1 v5.12.0-alpha1 v5.11.3 v5.11.2 v5.11.1 v5.11.0 v5.11.0-rc2 v5.11.0-rc1 v5.11.0-beta4 v5.11.0-beta3 v5.11.0-beta2 v5.11.0-beta1 v5.11.0-alpha1 v5.10.1 v5.10.0 v5.10.0-rc3 v5.10.0-rc2 v5.10.0-rc1 v5.10.0-beta4 v5.10.0-beta3 v5.10.0-beta2 v5.10.0-beta1 v5.10.0-alpha1 v5.9.9 v5.9.8 v5.9.7 v5.9.6 v5.9.5 v5.9.4 v5.9.3 v5.9.2 v5.9.1 v5.9.0 v5.9.0-rc2 v5.9.0-rc1 v5.9.0-beta4 v5.9.0-beta3 v5.9.0-beta2 v5.9.0-beta1 v5.9.0-alpha1 v5.8.0 v5.8.0-rc1 v5.8.0-beta1 v5.8.0-alpha1 v5.7.1 v5.7.0 v5.7.0-rc1 v5.7.0-beta1 v5.7.0-alpha1 v5.6.3 v5.6.2 v5.6.1 v5.6.1-1 v5.6.0 v5.6.0-rc1 v5.6.0-beta1 v5.6.0-alpha1 v5.5.1 v5.5.0 v5.5.0-rc1 v5.5.0-beta1 v5.5.0-alpha1 v5.4.2 v5.4.1 v5.4.0 v5.4.0-rc1 v5.4.0-beta1 v5.4.0-alpha1 v5.3.2 v5.3.1 v5.3.0 v5.3.0-rc1 v5.3.0-beta1 v5.3.0-alpha1 v5.2.1 v5.2.0 v5.2.0-rc1 v5.2.0-beta1 v5.2.0-alpha1 v5.1.1 v5.1.0 v5.1.0-rc2 v5.1.0-rc1 v5.1.0-beta1
No related merge requests found
Showing with 16 additions and 16 deletions
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
The Adding Types Example shows how to add a new object type, \c Person, to QML. The Adding Types Example shows how to add a new object type, \c Person, to QML.
The \c Person type can be used from QML like this: The \c Person type can be used from QML like this:
\snippet qml/referenceexamples/adding/example.qml 0 \snippet referenceexamples/adding/example.qml 0
\section1 Declare the Person class \section1 Declare the Person class
...@@ -43,11 +43,11 @@ with the two properties we want accessible on the QML type - name and shoeSize. ...@@ -43,11 +43,11 @@ with the two properties we want accessible on the QML type - name and shoeSize.
Although in this example we use the same name for the C++ class as the QML Although in this example we use the same name for the C++ class as the QML
type, the C++ class can be named differently, or appear in a namespace. type, the C++ class can be named differently, or appear in a namespace.
\snippet qml/referenceexamples/adding/person.h 0 \snippet referenceexamples/adding/person.h 0
\section1 Define the Person class \section1 Define the Person class
\snippet qml/referenceexamples/adding/person.cpp 0 \snippet referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply The Person class implementation is quite basic. The property accessors simply
return members of the object instance. return members of the object instance.
...@@ -78,16 +78,16 @@ properties in QML. This example adds a BirthdayParty type that specifies ...@@ -78,16 +78,16 @@ properties in QML. This example adds a BirthdayParty type that specifies
a birthday party, consisting of a celebrant and a list of guests. People are a birthday party, consisting of a celebrant and a list of guests. People are
specified using the People QML type built in the previous example. specified using the People QML type built in the previous example.
\snippet qml/referenceexamples/properties/example.qml 0 \snippet referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty \section1 Declare the BirthdayParty
The BirthdayParty class is declared like this: The BirthdayParty class is declared like this:
\snippet qml/referenceexamples/properties/birthdayparty.h 0 \snippet referenceexamples/properties/birthdayparty.h 0
\snippet qml/referenceexamples/properties/birthdayparty.h 1 \snippet referenceexamples/properties/birthdayparty.h 1
\snippet qml/referenceexamples/properties/birthdayparty.h 2 \snippet referenceexamples/properties/birthdayparty.h 2
\snippet qml/referenceexamples/properties/birthdayparty.h 3 \snippet referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a The class contains a member to store the celebrant object, and also a
QList<Person *> member. QList<Person *> member.
...@@ -104,7 +104,7 @@ scenarios. ...@@ -104,7 +104,7 @@ scenarios.
The implementation of BirthdayParty property accessors is straight forward. The implementation of BirthdayParty property accessors is straight forward.
\snippet qml/referenceexamples/properties/birthdayparty.cpp 0 \snippet referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example \section1 Running the example
...@@ -128,11 +128,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign ...@@ -128,11 +128,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
types of more than one type to a property. It specializes the Person type types of more than one type to a property. It specializes the Person type
developed in the previous examples into two types - a \c Boy and a \c Girl. developed in the previous examples into two types - a \c Boy and a \c Girl.
\snippet qml/referenceexamples/coercion/example.qml 0 \snippet referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl \section1 Declare Boy and Girl
\snippet qml/referenceexamples/coercion/person.h 0 \snippet referenceexamples/coercion/person.h 0
The Person class remains unaltered in this example and the Boy and Girl C++ The Person class remains unaltered in this example and the Boy and Girl C++
classes are trivial extensions of it. As an example, the inheritance used here classes are trivial extensions of it. As an example, the inheritance used here
...@@ -147,7 +147,7 @@ previous example. However, as we have repurposed the People class as a common ...@@ -147,7 +147,7 @@ previous example. However, as we have repurposed the People class as a common
base for Boy and Girl, we want to prevent it from being instantiated from QML base for Boy and Girl, we want to prevent it from being instantiated from QML
directly - an explicit Boy or Girl should be instantiated instead. directly - an explicit Boy or Girl should be instantiated instead.
\snippet qml/referenceexamples/coercion/main.cpp 0 \snippet referenceexamples/coercion/main.cpp 0
While we want to disallow instantiating Person from within QML, it still needs While we want to disallow instantiating Person from within QML, it still needs
to be registered with the QML engine, so that it can be used as a property type to be registered with the QML engine, so that it can be used as a property type
...@@ -157,7 +157,7 @@ and other types can be coerced to it. ...@@ -157,7 +157,7 @@ and other types can be coerced to it.
The implementation of Boy and Girl are trivial. The implementation of Boy and Girl are trivial.
\snippet qml/referenceexamples/coercion/person.cpp 1 \snippet referenceexamples/coercion/person.cpp 1
All that is necessary is to implement the constructor, and to register the types All that is necessary is to implement the constructor, and to register the types
and their QML name with the QML engine. and their QML name with the QML engine.
...@@ -167,7 +167,7 @@ and their QML name with the QML engine. ...@@ -167,7 +167,7 @@ and their QML name with the QML engine.
The BirthdayParty type has not changed since the previous example. The The BirthdayParty type has not changed since the previous example. The
celebrant and guests property still use the People type. celebrant and guests property still use the People type.
\snippet qml/referenceexamples/coercion/birthdayparty.h 0 \snippet referenceexamples/coercion/birthdayparty.h 0
However, as all three types, Person, Boy and Girl, have been registered with the However, as all three types, Person, Boy and Girl, have been registered with the
QML system, on assignment QML automatically (and type-safely) converts the Boy QML system, on assignment QML automatically (and type-safely) converts the Boy
...@@ -194,14 +194,14 @@ The Default Property Example is a minor modification of the ...@@ -194,14 +194,14 @@ The Default Property Example is a minor modification of the
\l {Extending QML - Inheritance and Coercion Example} that simplifies the \l {Extending QML - Inheritance and Coercion Example} that simplifies the
specification of a BirthdayParty through the use of a default property. specification of a BirthdayParty through the use of a default property.
\snippet qml/referenceexamples/default/example.qml 0 \snippet referenceexamples/default/example.qml 0
\section1 Declaring the BirthdayParty class \section1 Declaring the BirthdayParty class
The only difference between this example and the last, is the addition of the The only difference between this example and the last, is the addition of the
\c DefaultProperty class info annotation. \c DefaultProperty class info annotation.
\snippet qml/referenceexamples/default/birthdayparty.h 0 \snippet referenceexamples/default/birthdayparty.h 0
The default property specifies the property to assign to whenever an explicit The default property specifies the property to assign to whenever an explicit
property is not specified, in the case of the BirthdayParty type the guest property is not specified, in the case of the BirthdayParty type the guest
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment