aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-04-16 12:15:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-16 13:47:41 +0200
commitf012ddd23226808a459104d14654e9e25f749cb7 (patch)
tree2392a607b497895a5e43786e7f6fb15607b6c444 /src/qml/doc
parente62ded210d6794d9a51879c06b77427f7dcf4291 (diff)
Doc: Add required include statement for qmlRegisterSingletonType docs
Adds a missing include for QtQml into QQmlEngine class reference code snippets. Task-number: QTBUG-30642 Change-Id: I2ec10de5b31b4854d5aaea08987b9d75926d2ef4 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index 4a4de0531c..5db275407d 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -222,7 +222,7 @@
Usage:
\code
- // first, define the singleton type provider function (callback).
+ // First, define the singleton type provider function (callback).
static QJSValue *example_qjsvalue_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
@@ -233,7 +233,8 @@
return example;
}
- // second, register the singleton type provider with QML by calling this function in an initialization function.
+ // Second, register the singleton type provider with QML by calling this function in an initialization function.
+ #include <QtQml>
...
qmlRegisterSingletonType("Qt.example.qjsvalueApi", 1, 0, "MyApi", example_qjsvalue_singletontype_provider);
...
@@ -299,7 +300,7 @@
Usage:
\code
- // first, define your QObject which provides the functionality.
+ // First, define your QObject which provides the functionality.
class SingletonTypeExample : public QObject
{
Q_OBJECT
@@ -325,7 +326,7 @@
int m_someProperty;
};
- // second, define the singleton type provider function (callback).
+ // Second, define the singleton type provider function (callback).
static QObject *example_qobject_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
@@ -335,7 +336,8 @@
return example;
}
- // third, register the singleton type provider with QML by calling this function in an initialization function.
+ // Third, register the singleton type provider with QML by calling this function in an initialization function.
+ #include <QtQml>
...
qmlRegisterSingletonType<SingletonTypeExample>("Qt.example.qobjectSingleton", 1, 0, "MyApi", example_qobject_singletontype_provider);
...