White screen on launching application - Qt QML
-
No, i didn't.
I'll do that tomorrow and I'll let you know :) -
Ok, I just try to use WIndows command line to start the exe but there is no message displayed :(
-
That is because Windows is crap. Don't worry, you can still read the logs. Try "this":http://stackoverflow.com/questions/482678/how-to-capture-stderr-on-windows-dos or "this":http://support.microsoft.com/kb/308427.
-
There is no displayed error for both methods.
Should I deploy the application in debug or release? It is currently in release. -
Good idea, try with a debug build.
-
No message either :(
I read on forums that it could be a problem for QML plugin. However, I have imported all the files listed in the tutorial. -
I just found a solution.
I added in the application folder a directory qml/APPLICATION_NAME/ with qml files. Now it works.So I have a question. Is it mandatory to add the folder or can it be included in the exe?
-
It is not mandatory. You can include all QML files (and other files, too) using "Qt Resource Sytem":http://qt-project.org/doc/qt-5/resources.html.
-
Ok, thank you very much. This is very useful !
However, do you know how to automate this in QtCreator? -
Yes, Qt Creator will basically do all the work for you, don't worry. Just open your project and select Add New...->Qt->Qt Resource File. It will add the file, and you can put your QML files there through an easy, built-in GUI tool.
You also need to change one thing in your code: when you set the main QML file source (to QtQuick2ApplicationViewer, QQuickView, QQmlEngine, etc.), you need to change the path to this:
@
:/prefix/myMainQmlFIle.qml
//or
qrc:///prefix/myMainQmlFIle.qml
@ -
Ok, thank you for your answers, I learned a lot from you :)
Have a good day.
-
Thank you, you are welcome :-)