From: Topi Reinio Date: Tue, 16 Apr 2013 10:15:30 +0000 (+0200) Subject: Doc: Add required include statement for qmlRegisterSingletonType docs X-Git-Tag: upstream/5.2.1~803^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f012ddd23226808a459104d14654e9e25f749cb7;p=platform%2Fupstream%2Fqtdeclarative.git 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 --- diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 4a4de05..5db2754 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 ... 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 ... qmlRegisterSingletonType("Qt.example.qobjectSingleton", 1, 0, "MyApi", example_qobject_singletontype_provider); ...