Qt modules are not installed
-
Hi,
Do you have a AppName.pro file ?
-
Hey @SGaist !! Yes, I do. I let it here. I'm almost 100% sure that there is no problem with my .pro. Anyways, I find really strange that Qt has problem with the location of the files. What I know (from Qt documentation) is that resources must be located in the .qrc folder (or subfolder). But there is no comments about the relation between .pro and .qrc. What I could do to solve this is:
- Create a dummy.qml with the includes and an empty Item
- Locate the file with the .pro
- Add the file under OTHER_FILES
- Use the assets approach to access qml and other resources
Now, the QtQuick, QtQuick.Window and others Qt Modules are recognized but I'd like to use the qrc approach since it is multiplatform.
TEMPLATE = app QT += qml quick CONFIG += c++11 SOURCES += \ ../src/main.cpp \ # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Default rules for deployment. include(../deployment.pri) RESOURCES += ../qrc/qml.qrc DISTFILES += \ android/AndroidManifest.xml \ android/gradle/wrapper/gradle-wrapper.jar \ android/gradlew \ android/res/values/libs.xml \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.properties \ android/gradlew.bat ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
-
What does you main .pro file look like ?
-
Then I may have misunderstood your setup.
Isn't that .pro file in a subfolder called project in your source tree ?
-
@SGaist It might. Older qmake (or Qt Creator) versions definitely would get confused. I'm not sure about newest releases, I vaguely recall mentions of some fixes in this area, but I have not tested it. I keep my .pro files ordered as Qt expects it to ;)
-
Hey! Sorry for my late reply but it's 9am here! I tried (as @sierdzio said) just one .pro but I separated my files in folders (not the subdirs structure). Since I'm relative new to Qt and I discover every day something new, I don't know if what I've done it's ok or not.
Know I put all my resources (qml, sounds, images, etc) in the .pro's folder and I'm trying to make it work. It was just curiosity aboute why the .qrc has to be placed at the same level or in a subfolder from the .pro.
I'll mark this post as SOLVED because the problem is related to the project's structure and there is no problem with Qt.
Thank you guys!!
-
Currently the only rule I am aware of is that all the files you put in the .qrc must in the same folder or in a subfolder of where the .qrc file lives.
You may have found something new.