Qmlqtimeexampleplugin not working
-
has anyone got this pluginexample working? In my case it complains abaout not finding the plugins just like in my own examples and i cant wrap my head around why.
-
I too am also failing to load this plugin, when I run the application, it prompts for a QML file (qmlscene.exe). If I point the qmlscene to the plugins.qml - it spits out the following error information in the application output. The compile output seems to have no errors.
Starting C:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl\bin\qmlscene.exe...
file:///C:/Qt/Qt5.1.1/5.1.1/msvc2012_64_opengl/examples/qml/plugins/plugins.qml:41 module "TimeExample" is not installedC:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl\bin\qmlscene.exe exited with code -1
-
OK after mindlessly experimenting, I finally got the above plugin example to launch a clock - but I am not really sure why it should be so difficult given that many of the other examples simply work without having to do any special tricks other than qmake, build and run.
Anyway here are the steps I went through and hopefully someone can let me know what step is missing in my installation.
With the plugins project open, run clean, qmake & build to create the plugin dll. This built a debug plugin which was placed in the following strange folder (I don't know why QT puts files in this strange location). I would have thought it would have been placed within the project folder itself - but I guess its cleaner this way.
@C:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl\examples\qml\build-plugins-Desktop_Qt_5_1_1_MSVC2012_OpenGL_64bit-Debug\imports\TimeExample@
I then opened up a command prompt and attempted to do as per the instructions provided with the plugin
@qmlscene -I imports plugins.qml@
This indicated:
@file:///C:/Qt/Qt5.1.1/5.1.1/msvc2012_64_opengl/examples/qml/plugins/plugins.qml:41 module "TimeExample" plugin "qmlqtimeexampleplugin" not found@
Looks like this means that it could not find the built dll plugin.
I then merged the contents of the debug build output from @C:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl\examples\qml\build-plugins-Desktop_Qt_5_1_1_MSVC2012_OpenGL_64bit-Debug\imports\TimeExample@ into @imports\TimeExample@
basically the following build files were copied into the imports/TimeExample folder.
@qmlqtimeexampleplugin.dll
qmlqtimeexampleplugin.dll.embed.manifest
qmlqtimeexampleplugin.dll_manifest.rc
qmlqtimeexampleplugin.dll_manifest.res
qmlqtimeexampleplugin.exp
qmlqtimeexampleplugin.ilk
qmlqtimeexampleplugin.lib
qmlqtimeexampleplugin.pdb@Then I re-ran qmlscene
@qmlscene -I imports plugins.qml@
and it indicated
@file:///C:/Qt/Qt5.1.1/5.1.1/msvc2012_64_opengl/examples/qml/plugins/plugins.qml:41 plugin cannot be loaded for module "TimeExample": The plugin 'C:/Qt/Qt5.1.1/5.1.1/msvc2012_64_opengl/examples/qml/plugins/imports/TimeExample/qmlqtimeexample
plugin.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)@I then added CONFIG += release to the pro file and merged teh build output and it worked!!!!
OUCH how can this be so difficult!!! what is going wrong here. I am trying to create a plugin - could someone please help me to do this correctly and fix my configuration. I am a complete noob to QT and I need some experienced guidance to get me on the right track.