How to embed qml-files etc. in executable file? [solved]
-
Ah, you cannot compile a dll into the resource system. I do not think the library loader supports using the resource system. Also it doesn't really make sense to place a shared library inside the binary as it loses any benefit of being a shared library.
I think you'll need to remove your style plugin from the resource system and load that using the method I suggested above with QDeclarativeEngine::addImportPath().
-
Ah! I almost forget that libraries can't be resources.
It works now when styleplugin.dll is inside the .exe-folder.
I also placed a copy of styleplugin.dll inside the folder 'plugins' and added the following line in my main-function
@QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + "/plugins");@
but that doesn't work. What could be wrong here? applicationDirPath() returns the correct location.
-
OK, but that returns an error (I placed it in the main-function)
@QDeclarativeEngine::addImportPath(QCoreApplication::applicationDirPath() + "/plugins");@
@error: incomplete type 'QDeclarativeEngine' used in nested name specifier@
Adding it to the QmlApplicationViewer doesn't do anything
@ QmlApplicationViewer viewer;
viewer.addImportPath(QCoreApplication::applicationDirPath() + "/plugins");@Also the QtCreator-editor complains that it can't find both imports:
@import "qrc:/desktop-components/components"
import "qrc:/desktop-components/components/plugin"@ -
You set it solved but i can't see solution.. Could you write me solution?
-
Could you share code? thanks.
-
"look at cmake branch":https://github.com/nib952051/QtDesktopComponentsBackport/tree/cmake