summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/extending.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/declarative/extending.qdoc')
-rw-r--r--doc/src/declarative/extending.qdoc14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 5c4d5e7..6388764 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -965,6 +965,20 @@ Item {
}
\endcode
+This may be connected to via QObject::connect() or called directly from C++ using
+QMetaObject::invokeMethod():
+
+\code
+ QDeclarativeEngine engine;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile("main.qml"));
+ QObject *object = component.create(context);
+ QVariant str("Hello");
+ QMetaObject::invokeMethod(object, "say", Q_ARG(QVariant, str));
+\endcode
+
+Return values of type QVariant are also supported via Q_RETURN_ARG.
+
\section1 Defining new Components
\target components