summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-25 00:52:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-25 00:52:06 (GMT)
commit113a5ee20d682e3377634854571554b8af7cf4ae (patch)
tree9fdfdc9711a861abf03d8e4c563fe395ec4541a7 /doc/src/declarative
parent1e55b0ecf415d023bbb5f291a2f26ba50c1a508b (diff)
downloadQt-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.qdoc17
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