Qt Creator lookin in the wrong place for QML files
-
I created my first real QML project with Qt Creator. It worked fine, code compiled and run without any issues. Then I modified the the .pro file to work in Visual Studio 2008 by add support for things like precompiled headers and a number of other things.
After the modifications, the project will compile in both Qt Creator and within Visual Studio 2008. It runs fine from Visual Studio 2008, but not from Qt Creator. I get this error:
file:///D:/MSDev/PhotoParata/Qt/Debug/qml/SalesCenter/main.qml: File not found
Considering the project is here: D:\MSDev\PhotoParata\Qt\SalesCenter and the qml files are in D:\MSDev\PhotoParata\Qt\SalesCenter\qml\SalesCenter, I am guessing that there is some setting in the .pro fix the issue.
Here is the .pro file:
@# Add more folders to ship with the application, here
folder_01.source = qml/SalesCenter
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
Avoid auto screen rotation
#DEFINES += ORIENTATIONLOCK
Needs to be defined for Symbian
QT += sql
CONFIG += debug_and_release
DEFINES += QT_LARGEILE_SUPPORT QT_SQL_LIB _USE_32BIT_TIME_T NETWORKACCESS
QTPLUGIN += qjpeg
INCLUDEPATH += ./../../../../include ./GeneratedFiles .
PRECOMPILED_HEADER = stdafx.h
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFilesCONFIG(debug, debug|release) {
DESTDIR = ../Debug
LIBS += -L../Debug
OBJECTS_DIR += Debug
MOC_DIR += ./GeneratedFiles/Debug
INCLUDEPATH += ./GeneratedFiles/Debug
} else {
DESTDIR = ../Release
LIBS += -L../Release
OBJECTS_DIR += Release
MOC_DIR += ./GeneratedFiles/Release
INCLUDEPATH += ./GeneratedFiles/Release
}symbian:TARGET.UID3 = 0xE46A320F
Smart Installer package's UID
This UID is from the protected range
and therefore the package will fail to install if self-signed
By default qmake uses the unprotected range value if unprotected UID is defined for the application
and 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
Define QMLJSDEBUGGER to allow debugging of QML in debug builds
(This might significantly increase build time)
DEFINES += QMLJSDEBUGGER
If your application uses the Qt Mobility libraries, uncomment
the following lines and add the respective components to the
MOBILITY variable.
CONFIG += mobility
MOBILITY +=
The .cpp file which was generated for your project. Feel free to hack it.
Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()include(SalesCenter.pri)@
-
Before I made changes, Qt Creator was didn't have path issues running the app, but now it does. The question is why:
Is it because Qt Creator was coping the files and now isn't?
Is it because Qt Creator was changing or setting some path variable and now isn't?
Is it something else?
Obviously there is something that changed in the .pro file, the only question is how do I correct it?
Sam
-
It's because you now have a Debug and Release dir set up.
file:///D:/MSDev/PhotoParata/Qt/Debug/qml/SalesCenter/main.qml: File not found
Previously it would have looked for D:/MSDev/PhotoParata/Qt/qml/SalesCenter/main.qml
Because the source says: folder_01.source = qml/SalesCenter
-
So, how do I fix this? I tried commenting out both the DESTDIR and the LIBS, but now it won't compile in Qt Creator. The goal is to create a .pro file that will work with both development environments. Sorry Nokia, VS2008 simply has way too many features for C++ not to use it, besides, I still have not figured out how to get Qt Creator to debug the code.