Getting an all-white screen on deploying Qt Quick demo app Minehunt

北城以北 提交于 2019-12-10 11:32:36

问题


To test the deployment process I am trying to deploy the included demo app Minehunt. I am able to get it to run, no crashing or errors, but the screen is all white.

I believe this generally means that I am missing plugins. Dependency walker reports no problems, and I even tried including ALL the plugins from the Qt MingW plugins directory, but no such luck.

Here is what I am including so far; Can anyone advise what else I need to add to get it to run?


回答1:


Your dlls don't look bad at all. I think, too, that it's your plugins. Even if they are there, there is a good chance, that your program don't find them. Qt is a bit picky where to look by default. You might try qt.conf. This is a small textfile you must create in the folder where your executable lies. It contains the path to your Qt plugins.

For instance, in one of my projects I have the followin folder layout:

Appfolder
  plugin
    qt
      plugins
        imageformats
        sqldrivers
   myapp.exe
   qt.conf
   ...many dlls...

Then I added a qt.conf file to the Appfolder, which has the following content:

[Paths] 
Plugins = plugins/qt/plugins

My program is Qt 4, but I don't think this aspect of plugin deployment changed in Qt5. All my qt dlls are in qt. And I add the following PATH: SET PATH=.\plugins;.\plugins\qt;%PATH%. Works like a charm on any Windows I ever tried.

Edit: I then created a .bat file, which does:

SET PATH=.\plugins;.\plugins\qt;%PATH%
cd Appfolder
start myapp

This was an ugly quick fix, which I did not have the time to replace with something better, yet.




回答2:


If application runs and shows blank screen then that usually indicates two things :

  1. All the dependencies (dlls) are probably present and detected properly.
  2. Most probably whats missing is the presence of qml files at the correct location.

In your main.cpp check the path of qml file which you would have given, and see if relatively that folder is present at the same location corresponding to your executable.

Also, instead of running the executable by double clicking, run it through the command line. It might print some messages if it is not able to locate some images/files/other dependencies etc according to the specified paths.


Edit 1 :

Add this flag in the .pro file :

 CONFIG += console

It will give the exact debug message in a console once you run the application.



来源:https://stackoverflow.com/questions/18503139/getting-an-all-white-screen-on-deploying-qt-quick-demo-app-minehunt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!