Doc: Add required include statement for qmlRegisterSingletonType docs
authorTopi Reinio <topi.reinio@digia.com>
Tue, 16 Apr 2013 10:15:30 +0000 (12:15 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 16 Apr 2013 11:47:41 +0000 (13:47 +0200)
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>
src/qml/doc/src/qmlfunctions.qdoc

index 4a4de05..5db2754 100644 (file)
 
    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)
        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);
    ...
 
    Usage:
    \code
-   // first, define your QObject which provides the functionality.
+   // First, define your QObject which provides the functionality.
    class SingletonTypeExample : public QObject
    {
        Q_OBJECT
        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)
        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);
    ...