aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-12 17:03:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-01-13 16:47:57 +0100
commit2c3419e127e55810da1741725b4ff39f118cd577 (patch)
tree670ec93d28dadad06bd840a5694935ef8a7b2ac0 /src/qml/doc/src
parent4eff7299501ff932071300b3fa34fbeccb03d0d8 (diff)
Generate registrations for all examples
Now that we can generate all QML type information at build time, we should also use it. Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc19
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/qqmlextensionplugin.qdocinc2
2 files changed, 9 insertions, 12 deletions
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index 43987354ae..d587173e5a 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -133,10 +133,9 @@ Here is the application \c main.cpp:
\snippet tutorials/extending-qml/chapter1-basics/main.cpp 0
-This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart",
-in a type namespace called "Charts", with a version of 1.0.
-
-Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
+We write a \c .pro project file that includes the files and the \c qml library, and
+defines a type namespace called "Charts" with a version of 1.0 for any types exposed
+to QML:
\quotefile tutorials/extending-qml/chapter1-basics/chapter1-basics.pro
@@ -314,15 +313,13 @@ item when its contents are drawn:
\snippet tutorials/extending-qml/chapter4-customPropertyTypes/piechart.cpp 0
-Like the \c PieChart type, the \c PieSlice type has to be registered
-using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the
-type to the "Charts" type namespace, version 1.0:
+Like the \c PieChart type, the \c PieSlice type has to be exposted to QML
+using QML_ELEMENT. As with \c PieChart, we add the "Charts" type namespace,
+version 1.0 to the .pro file:
-\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 0
-\dots
-\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 1
+\snippet tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h 0
\dots
-\snippet tutorials/extending-qml/chapter4-customPropertyTypes/main.cpp 2
+\quotefile tutorials/extending-qml/chapter1-basics/chapter4-customPropertyTypes.pro
The source code from the following files are referred to in this chapter:
\generatelist examplefiles .*chapter4.*
diff --git a/src/qml/doc/src/qmllanguageref/modules/qqmlextensionplugin.qdocinc b/src/qml/doc/src/qmllanguageref/modules/qqmlextensionplugin.qdocinc
index 01e81e7c19..05447db627 100644
--- a/src/qml/doc/src/qmllanguageref/modules/qqmlextensionplugin.qdocinc
+++ b/src/qml/doc/src/qmllanguageref/modules/qqmlextensionplugin.qdocinc
@@ -29,7 +29,7 @@ Suppose there is a new \c TimeModel C++ class that should be made available
as a new QML type. It provides the current time through \c hour and \c minute
properties.
-\snippet qmlextensionplugins/plugin.cpp 0
+\snippet qmlextensionplugins/timemodel.h 0
\dots
To make this type available, we create a plugin class named \c QExampleQmlPlugin