Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can only execute application from editor
All I get upon executing my application is a blank screen as if it couldn't find the main qml file. That isn't the case though because upon investigating with ProcMon I put it in the correct location.
All FILE NOT FOUNDs ProcMon now returns are:
@D:\MyProject\release\TraktorScrobbler.exe.Local NAME NOT FOUND
D:\MyProject\release\WINMM.DLL NAME NOT FOUND
D:\MyProject\release\WINSPOOL.DRV NAME NOT FOUND
D:\MyProject\release\dwmapi.dll NAME NOT FOUND
D:\MyProject\release\CRYPTBASE.dll NAME NOT FOUND
D:\MyProject\release\CRYPTSP.dll NAME NOT FOUND
D:\MyProject\release\RpcRtRemote.dll NAME NOT FOUND
I also have been following the other threads covering this problem, like this one http://developer.qt.nokia.com/forums/viewthread/5310/ but it didn't quite fix my problem.
What else could I have overseen?
DenisKormalev last edited by
I don't think anybody can help you with such vague description of problem. Maybe you can post here some realted code snippets?
OK, let me-- some information!
That's how my project-folder looks:
| +[All images]
I am using the QML Desktop Components mentioned here http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
My main.cpp-file looks like this:
int main(int argc, char *argv)
QApplication app(argc, argv);
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + "/plugins"); QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); QmlCppMediator m_qmlCppMediator; QDeclarativeContext *context = viewer.rootContext(); context->setContextProperty("cppInterface", &m_qmlCppMediator); viewer.setMainQmlFile(QLatin1String("qml/MyProject/main.qml")); viewer.showExpanded(); return app.exec();
sigrid last edited by
Does it help specifying an absolute path instead of a relative path in viewer.setMainQmlFile()?
If not, does it show up if you use a QDeclarativeView instead of QmlApplicationViewer?
If so, this indicates there is a problem in the QmlApplicationViewer class.
I will test it this evening.
It was indeed the path.
I changed the line to:
@viewer.setMainQmlFile(QString(QCoreApplication::applicationDirPath() + "/qml/TraktorScrobbler/main.qml"));@
It now works. Now I've to work on a way to embedd all the qml-crap in the exe-file.