1

I have wrote a Qt Quick Desktop application in c++ qnd Qt Creator(QML) on Windows7. Now I have to deploy it.

I'm using Qt Quick Desktop Components plugin in my application, I've installed it according to these instructions, and I'm using it with:"import Qt.labs.components", as written there.

I tried adding to the .pro file:

QML_IMPORT_PATH = C:\QtSDK\Desktop\Qt\4.7.4\mingw\imports\Qt\labs\components

but I saw it's working well without it, and I removed it.

I've read a guide how to deploy such an application here, and followed it; I have now a deployment folder, with: the .exe file, the needed dll's, and a folder hierarchy like:Qt/labs/components.

in components I put the styleplugin.dll(for desktop components), and a qmldir file, with the content: plugin styleplugin, excactly like in the doc.

but when I'm runnig my application.exe from the deployment folder in another computer, I'm getting a white, empty window, means: It didn't find the .dll file.

Should you explain me please what's wrong?

Community
  • 1
  • 1
user1835297
  • 1,059
  • 2
  • 12
  • 24

1 Answers1

2

I know two reasons, when app can not load plugin dll:

  1. Some of dependecies of the plugin dll are missing or can not be found and that is why it can not be loaded. Qt Creator or Visual Studio environment can be different than the system one. For example, your IDE can modify PATH environment variable. Check plugin's dependencies availability with Microsoft Dependency Walker tool in the same environment where you launch your app.
  2. App can not find plugin in standard directories. To check this you should specify plugin import directory explicitly:

    QDeclarativeView *rootView = new QDeclarativeView()
    rootView->engine()->addImportPath(QLatin1String("path/to/your/imports"));
    
Pavel Osipov
  • 2,067
  • 1
  • 19
  • 27
  • Tnx, I fixed the import path and now qt knows where to find the components folder, but it seems like the styleplugin.dll file is not enough, and I need to have in the deployment folder all the .qml files, without it it doesn't work, but I want the .dll file to work stand alone, with no the .qml's. Now I have in my deployment folder: application.exe, the rest .dll's, and a folder hierarchy like:Qt/labs/components. in components folder I must have all the components qml's, qmldir file of the components qml's, and plugin folder with the styleplugin.dll. I must find any way to resign the qml's!!!! – user1835297 Nov 28 '12 at 10:34
  • I have no idea how to hide qml files of the plugin. All plugins I have seen export them as is. Let me know here if you'll find a solution. – Pavel Osipov Nov 28 '12 at 17:02
  • if qmldir files reference dll plugins via relative paths, that may be doable (i.e. plugin myplugin ../../../myplugin.dll or smth alike) Такие пироги :) – mlvljr Dec 04 '12 at 01:55