Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Module Not Found QtQuick.Window
Qt 6.11 is out! See what's new in the release blog

QML Module Not Found QtQuick.Window

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
13 Posts 2 Posters 10.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MH24
    wrote on last edited by
    #1

    Trying to make a simple QtQuick project. But running into this error when I Build. Using Qt Creator 6.0.2 Based on Qt 5.15.3 (GCC 11.2.0, 64 bit)
    Linux, Ubuntu 22.04.
    The error is in main.qml which is as follows:

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    }
    

    I have added /usr/lib/x86_64-linux-gnu/qt6/qml to the QML_IMPORT_PATH in the .pro file.

    How do I fix this?

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @MH24 said in QML Module Not Found QtQuick.Window:

      QML_IMPORT_PATH

      QML_IMPORT_PATH is for your own QML modules, not for /usr/lib/x86_64-linux-gnu/qt6/qml. What is the error message?

      M 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @MH24 said in QML Module Not Found QtQuick.Window:

        QML_IMPORT_PATH

        QML_IMPORT_PATH is for your own QML modules, not for /usr/lib/x86_64-linux-gnu/qt6/qml. What is the error message?

        M Offline
        M Offline
        MH24
        wrote on last edited by
        #3

        @JoeCFD Error is: Unknown module(s) in QT:quick

        JoeCFDJ 1 Reply Last reply
        0
        • M MH24

          @JoeCFD Error is: Unknown module(s) in QT:quick

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @MH24 can you show your pro file here?

          M 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @MH24 can you show your pro file here?

            M Offline
            M Offline
            MH24
            wrote on last edited by
            #5

            @JoeCFD

            QT += quick
            
            
            SOURCES += \
                    main.cpp
            
            RESOURCES += qml.qrc
            
            QML_IMPORT_PATH = 
            
            QML_DESIGNER_IMPORT_PATH =
            
            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target
            
            1 Reply Last reply
            0
            • JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              @MH24 said in QML Module Not Found QtQuick.Window:

              : Unknown module(s) in QT:quick

              https://stackoverflow.com/questions/39390824/error-unknown-modules-in-qt-qml-quick-qt-creator
              install qt5-qtdeclarative-devel

              M 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @MH24 said in QML Module Not Found QtQuick.Window:

                : Unknown module(s) in QT:quick

                https://stackoverflow.com/questions/39390824/error-unknown-modules-in-qt-qml-quick-qt-creator
                install qt5-qtdeclarative-devel

                M Offline
                M Offline
                MH24
                wrote on last edited by
                #7

                @JoeCFD I did that. Still same error

                JoeCFDJ 1 Reply Last reply
                0
                • M MH24

                  @JoeCFD I did that. Still same error

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by
                  #8

                  @MH24 install qtquickcontrols2-5-dev as well.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MH24
                    wrote on last edited by
                    #9

                    @JoeCFD said in QML Module Not Found QtQuick.Window:

                    qtquickcontrols2-5-dev

                    Same error

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MH24
                      wrote on last edited by
                      #10

                      I am trying the qt6 book and discovered something regarding kits.

                      Made the Qt Quick UI Project and it created a qmlproject and qml file (with same error as above). When I hovered on the project it said 'No kits are available for this project'. When I went to 'Projects' tab on left it opens 'Configure Project' says 'No suitable kits found' and 'Desktop' under kits is greyed out.

                      What does this mean?

                      1 Reply Last reply
                      0
                      • JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by
                        #11

                        add other two into your pro file. BTW. from Qt6 cmake is preferred, I guess.
                        QT += qml quick quickwidgets

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          MH24
                          wrote on last edited by
                          #12

                          So I created a new kit by manually pointing to Qt 5.15.3 (qt5) instead of Qt 6.2.4. Qt QUick UI Project works fine but others still do not even when I point them to this kit.

                          JoeCFDJ 1 Reply Last reply
                          0
                          • M MH24

                            So I created a new kit by manually pointing to Qt 5.15.3 (qt5) instead of Qt 6.2.4. Qt QUick UI Project works fine but others still do not even when I point them to this kit.

                            JoeCFDJ Offline
                            JoeCFDJ Offline
                            JoeCFD
                            wrote on last edited by JoeCFD
                            #13

                            @MH24 Qt 6.2.4 is too new for Qt6. Try Qt6.4 or above. if you use Qt6, drop the version numbers in the rows of import.

                            import QtQuick 
                            import QtQuick.Window
                            
                            Window {
                               width: 640
                               height: 480
                               visible: true
                               title: qsTr("Hello World")
                            }
                            
                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved