QQuickWidget is blank on other computers
I added a QQuickWidget to a pure widget based app and I have a problem. On end computers the program just shows blank space in the place of QQuickWidget. I'm on Windows OS.
I had a similar problem already on my computer - when I started the .exe file directly, it crashed when QQuickWidget was about to be shown, but everything ran well from Visual Studio. I realized that I had to copy Qt5QuickWidgets.dll and D3Dcompiler*.dll to application directory. Then I was able to run .exe directly, but on deployment PCs even this doesn't work.
I also tried windeployqt tool and copied all files to the other PC, didn't help. Any suggestions?
[quote author="ondrejandrej" date="1421750779"]I also tried windeployqt tool and copied all files to the other PC, didn't help.[/quote]Did you copy them to the correct locations?
See http://qt-project.org/wiki/Deploy_an_Application_on_Windows -- pay particular attention to Step #3 under "Initial deployment (Quick and dirty)" for your development PC.
Thanks, that works. I was missing the QtQuick subdirectory.
I now have all the used QML elements in QtQuick\Controls, their styles in QtQuick\Controls\Styles\ and style images in QtQuick\Controls\Styles\Base\images. I'm not quite comfortable adding all this to installer package. I have the impression that the end user might modify the files and hack the program.
Can I avoid copying those files e. g. by adding them to resources?
[quote author="ondrejandrej" date="1421762292"]Can I avoid copying those files e. g. by adding them to resources?[/quote]Interesting idea; I've never tried putting official files in a resource before. You could try it, but I'm not sure if the LGPL license allows that.
If you have the "Professional license":http://www.qt.io/download/ you could use the Qt Quick Compiler to convert your QML source code into your program binaries.