diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-08-31 08:43:46 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-08-31 08:43:46 (GMT) |
commit | ad229913fd89aa0a33fb9b37ac96ff63c89a05f8 (patch) | |
tree | feed3678fd98565bb99a159a7e1bdb395df516ea /doc | |
parent | be69c316c56379d2b955491ffc54754018079dec (diff) | |
parent | cf28f6cacf59d434072656af05466541ba69e8ae (diff) | |
download | Qt-ad229913fd89aa0a33fb9b37ac96ff63c89a05f8.zip Qt-ad229913fd89aa0a33fb9b37ac96ff63c89a05f8.tar.gz Qt-ad229913fd89aa0a33fb9b37ac96ff63c89a05f8.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1.git into doc-4.7
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/extending.qdoc | 14 |
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 |