From 62c243c979b172ae554f372a0d883c0273cafc53 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Fri, 18 Jan 2013 16:27:42 +0100 Subject: Refactor the QObject QWebChannel and make the API reusable. It might becme a very common use case of the QWebChannel QML plugin. Thus it should be as simple as possible for third party consumers to setup a QWebChannel for QObject publishing. The new API basically moves the QtMetaObjectPublisher along with the JavaScript marshalling to the qwebchannl/src folder. The updated qtobject example shows how this new API can be used. Furthermore note how it is now trivially possible to register multiple objects, which was not easily possible before. Some notes on the applied refactoring: - qobject.js contains the JavaScript QObject binding and was refactored to support multiple objects. - the MetaObjectPublisher contains a new handleRequest function which handles the QML-side of the QObject binding. This is implemented in QML, while the other book keeping and esp. the classInfoForObject is still handled in C++ via the QtMetaObjectPublisher class (which is registered as MetaObjectPublisherPrivate and used by MetaObjectPublisher) Change-Id: Id45121bb654447e095bf8a8062d0c8edf9dcb018 Reviewed-by: Pierre Rossi --- src/src.pro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/src.pro') diff --git a/src/src.pro b/src/src.pro index 1f940c6..1f5a62e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -13,7 +13,6 @@ SOURCES += qwebchannel_plugin.cpp HEADERS += qwebchannel_plugin.h OTHER_FILES = qmldir \ - qwebchannel.js \ qtc_packaging/debian_harmattan/rules \ qtc_packaging/debian_harmattan/README \ qtc_packaging/debian_harmattan/copyright \ @@ -21,7 +20,9 @@ OTHER_FILES = qmldir \ qtc_packaging/debian_harmattan/compat \ qtc_packaging/debian_harmattan/changelog \ webchannel.js \ - webchannel-iframe.html + qobject.js \ + webchannel-iframe.html \ + MetaObjectPublisher.qml !equals(_PRO_FILE_PWD_, $$OUT_PWD) { copy_qmldir.target = $$OUT_PWD/qmldir @@ -33,7 +34,7 @@ OTHER_FILES = qmldir \ target.path = $$[QT_INSTALL_QML]/$$TARGETPATH -qmldir.files += $$PWD/qmldir +qmldir.files += $$PWD/qmldir $$PWD/MetaObjectPublisher.qml qmldir.path += $$[QT_INSTALL_QML]/$$TARGETPATH INSTALLS += target qmldir -- cgit v1.2.1