diff options
author | David Boddie <dboddie@trolltech.com> | 2010-08-31 12:03:44 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-08-31 12:03:44 (GMT) |
commit | aec1d2b85b3a818350b70bbb27790dee6ac35327 (patch) | |
tree | ab37d5df921ee1c4ca09b9d582ddf562c3fef8c1 /doc/src | |
parent | 2192d722a0b2af2aae0a8c45741f1ee4fd28269c (diff) | |
parent | 500e4d4a7faef619354cb92b6bf7df6a639d29e3 (diff) | |
download | Qt-aec1d2b85b3a818350b70bbb27790dee6ac35327.zip Qt-aec1d2b85b3a818350b70bbb27790dee6ac35327.tar.gz Qt-aec1d2b85b3a818350b70bbb27790dee6ac35327.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'doc/src')
-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 |