diff options
Diffstat (limited to 'examples/qml/doc/src/qml-extending.qdoc')
-rw-r--r-- | examples/qml/doc/src/qml-extending.qdoc | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/examples/qml/doc/src/qml-extending.qdoc b/examples/qml/doc/src/qml-extending.qdoc index 0812a3dba1..b4174426a8 100644 --- a/examples/qml/doc/src/qml-extending.qdoc +++ b/examples/qml/doc/src/qml-extending.qdoc @@ -75,9 +75,21 @@ This example builds on: Shows how to use \l {QQmlEngine::}{qmlRegisterExtendedType()} to provide an \l {Registering Extension Objects}{extension object} to a \l QLineEdit without modifying or -subclassing. The QML engine instantiates a \l QLineEdit and sets a property that -only exists on the extension type. The extension type performs calls on the \l -QLineEdit that otherwise will not be accessible to the QML engine. +subclassing. + +\snippet referenceexamples/extended/main.cpp 0 + +The QML engine instantiates a \l QLineEdit + +\snippet referenceexamples/extended/main.cpp 1 + +and sets a property that oly exists on the extension type. + +\snippet referenceexamples/extended/example.qml 0 + +The QML engine instantiates a \l QLineEdit and sets a property that +only exists on the extension type. The extension type performs calls on the +\l QLineEdit that otherwise will not be accessible to the QML engine. */ @@ -293,12 +305,20 @@ This example builds on: This example builds on: \list -\li \l {Extending QML - Default Property Example} \li \l {Extending QML - Inheritance and Coercion Example} \li \l {Extending QML - Object and List Property Types Example} \li \l {Extending QML - Adding Types Example} \endlist +The Methods Example has an additional method in the \c BirthdayParty class: \c invite(). +\c invite() is declared with \l Q_INVOKABLE so that it can be +called from QML. + +\snippet referenceexamples/methods/birthdayparty.h 0 + +In \c example.qml, the \c invite() method is called in the \l [QML]{QtQml::Component::completed()}{Component.onCompleted} signal handler: + +\snippet referenceexamples/methods/example.qml 0 */ /*! |