Question: how to develop qt extensionplugin with C++ code bringing data and qml showing the data
-
I have developed a simple qt project which get data using C++ code and expose it to qml.In the project I used QQuickView::setContextProperty to expose a QObject instance "shelper" to qml and QmlContext::setSource to set target qml. the exe execute successfully showing data in "shelper".
Now, I need to develop a project with same function but output as a plugin which can be called by other project. I reffer to "QML Plugin Example" and use QQmlExtensionPlugin to impliment it but I failed. Using the qmlscene.exe I can see all elements defined in qml except elements showing data . Reffer to the previous exe version. I find that QQmlExtensionPlugin has no function or visitor to set qml source and so no qml is set as the source to which QObject "shelper" is exposed.
Anyone know how to develop qt extensionplugin with C++ code bringing data and qml showing the data?
information:
Qt 5.2.0(windows qt-windows-opensource-5.2.0-msvc2010-x86-offline)Any help would be appreciated!