Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

qtcreator not showing my QML files in Projects list



  • My project’s qml files are not displayed in qtcreator’s Projects list. Files myproject.pro, qml.qrc and main.qml are all in the top-level directory of my project. myproject.pro includes “RESOURCES += qml.qrc”

    All files specified by qml.qrc including .qml files do exist:

    <RCC>
        <qresource prefix="/">
            <file>main.qml</file>
            <file>qtquickcontrols2.conf</file>
            <file>bathymetry.bmp</file>
            <file>ui-components/Settings2dWindow.qml</file>
            <file>ui-components/Settings3dWindow.qml</file>
            <file>ui-components/Popup.qml</file>
            <file>shaders/simple.vert</file>
            <file>shaders/simple.frag</file>
            <file>shaders/shader.vert</file>
            <file>shaders/shader.frag</file>
            <file>shaders/test.frag</file>
            <file>shaders/test.vert</file>
        </qresource>
    </RCC>
    

    Full myproject.pro at end of post.
    What am I missing?

    Qt Creator 4.11.1 based on Qt 5.14.1 Qt 5.13.1 OS: Ubuntu 18.04.3

    Thanks,
    Tom

    QT += quick
    QT += opengl
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Refer to the documentation for the
    # deprecated API to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp \
        backend.cpp \
        squircle.cpp \
        Topography.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    HEADERS += \
        backend.h \
        squircle.h \
        Topography.h \
        Vertex.h
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/release/ -lmbaux
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/debug/ -lmbaux
    else:unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lmbaux
    
    INCLUDEPATH += $$PWD/../../../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../../../usr/local/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/release/ -lgmt
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/debug/ -lgmt
    else:unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lgmt
    
    INCLUDEPATH += $$PWD/../../../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../../../usr/local/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/release/ -lmbview
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/debug/ -lmbview
    else:unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lmbview
    
    INCLUDEPATH += $$PWD/../../../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../../../usr/local/include
    
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/release/ -lmbio
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/debug/ -lmbio
    else:unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lmbio
    
    INCLUDEPATH += $$PWD/../../../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../../../usr/local/include
    
    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/release/libmbio.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/debug/libmbio.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/release/mbio.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/debug/mbio.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/libmbio.a
    
    


  • Added this line to myproject.pro and now the QML folder shows up in the Projects list, containing those three files:

    RESOURCES += main.qml Page1Form.ui.qml Page2Form.ui.qml
    
    

    Yet these files are already in qml.qrc, which is already listed in myproject.pro - why must I add them manually?


Log in to reply