diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-25 00:52:06 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-25 00:52:06 (GMT) |
commit | 113a5ee20d682e3377634854571554b8af7cf4ae (patch) | |
tree | 9fdfdc9711a861abf03d8e4c563fe395ec4541a7 /doc/src/declarative | |
parent | 1e55b0ecf415d023bbb5f291a2f26ba50c1a508b (diff) | |
download | Qt-113a5ee20d682e3377634854571554b8af7cf4ae.zip Qt-113a5ee20d682e3377634854571554b8af7cf4ae.tar.gz Qt-113a5ee20d682e3377634854571554b8af7cf4ae.tar.bz2 |
Document calling QObject methods from QML in Extending QML in C++ docs.
Diffstat (limited to 'doc/src/declarative')
-rw-r--r-- | doc/src/declarative/extending.qdoc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 3acfbdf..5c4d5e7 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -434,6 +434,23 @@ NOTIFY signal in C++. See also \l {Extending types from QML}. +\section1 Methods + +Slots and methods marked Q_INVOKABLE may be called as functions in QML. + +\snippet examples/declarative/cppextensions/referenceexamples/methods/example.qml 0 + +In this example an invitation is added via an \c {invite()} invokable method of +the BirthdayParty element. This function is available in QML by marking the \c {invite()} +method with Q_INVOKABLE in the BirthdayParty class: + +\snippet examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h 0 + +\l {Extending QML - Methods Example} shows the complete code used to +implement the invite() method. + +The \c {invite()} method is similarly available if it is declared as a slot. + \section1 Property Value Sources \snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0 |