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. QtCreator design editor can't open template QML file.
Forum Updated to NodeBB v4.3 + New Features

QtCreator design editor can't open template QML file.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 790 Views 1 Watching
  • 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
    Magicrafter13
    wrote on 10 Jul 2023, 02:03 last edited by
    #1

    I have no experience with Qt or QtCreator, and I'm attempting to learn by creating my first project. I used a built-in template, in this case the Python "Qt Quick Application - Empty" template

    When I click the Design button, I get 3 errors:

    • Line: 0: Qt Quick 6 is not supported with a Qt 5 Kit.
    • Line: 1: QML module not found (QtQuick).
    • Line: 2: QML module not found (QtQuick.Window).

    The last 2 show up in the code editor and I'm not too worried about them as the program builds and runs fine. But the first error doesn't make much sense to me and I'm assuming it is the reason I can't edit the layout graphically...

    I checked my "kits" in the settings, and noticed it only showed Qt 5.15.9 in Qt Versions (it found it via PATH), so I manually added /bin/qtmake6 since I have it as well.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aran
      wrote on 10 Jul 2023, 02:17 last edited by aran 7 Oct 2023, 02:18
      #2

      The first error does indeed mean that it attempts to use a Qt 5 Kit with a Qt Quick 6 application. After adding Qt 6 as kit, you should be able to select it on the start page with the overview of all examples (there should be a dropdown menu with the kits near the top left).

      The two latter errors probably stem from that issue above, a missmatch in the Qt versions.

      M 1 Reply Last reply 10 Jul 2023, 04:32
      0
      • A aran
        10 Jul 2023, 02:17

        The first error does indeed mean that it attempts to use a Qt 5 Kit with a Qt Quick 6 application. After adding Qt 6 as kit, you should be able to select it on the start page with the overview of all examples (there should be a dropdown menu with the kits near the top left).

        The two latter errors probably stem from that issue above, a missmatch in the Qt versions.

        M Offline
        M Offline
        Magicrafter13
        wrote on 10 Jul 2023, 04:32 last edited by Magicrafter13 7 Oct 2023, 04:41
        #3

        @aran I wasn't using an example, just one of the templates from the New Project menu. In fact, my examples screen is empty...

        Also, interestingly, Qt 6 (6.5.0) is my only option in that drop down list, no Qt 5.

        Edit: your comment did get me searching a bit more, and I've resolved the line 0 error about Qt version, however the other 2 still did not go away and I still cannot design the layout (the OK button doesn't do anything):

        22050976-85f2-4d43-a5c3-367a18c9b129-image.png

        I resolved the line 0 error by going to Edit -> Preferences... -> Kits -> Kits -> Select Desktop (default) under Manual -> Scroll down to Qt version drop-down -> Select Qt 6.5.0 ().

        Checking in /usr/lib/qt/qml I do see QtQuick (and like I said earlier, the project does build), so this seems to be the Designer not reading whatever info the project already has available (somewhere)...


        Here's the templated code:

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

        In the editor window, the two lines say QML module not found (<module>)., but in the Issues tab at the bottom of the IDE, those two lines show a different error: package import requires a version number.

        J 1 Reply Last reply 12 Jul 2023, 03:36
        0
        • M Magicrafter13
          10 Jul 2023, 04:32

          @aran I wasn't using an example, just one of the templates from the New Project menu. In fact, my examples screen is empty...

          Also, interestingly, Qt 6 (6.5.0) is my only option in that drop down list, no Qt 5.

          Edit: your comment did get me searching a bit more, and I've resolved the line 0 error about Qt version, however the other 2 still did not go away and I still cannot design the layout (the OK button doesn't do anything):

          22050976-85f2-4d43-a5c3-367a18c9b129-image.png

          I resolved the line 0 error by going to Edit -> Preferences... -> Kits -> Kits -> Select Desktop (default) under Manual -> Scroll down to Qt version drop-down -> Select Qt 6.5.0 ().

          Checking in /usr/lib/qt/qml I do see QtQuick (and like I said earlier, the project does build), so this seems to be the Designer not reading whatever info the project already has available (somewhere)...


          Here's the templated code:

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

          In the editor window, the two lines say QML module not found (<module>)., but in the Issues tab at the bottom of the IDE, those two lines show a different error: package import requires a version number.

          J Offline
          J Offline
          JKSH
          Moderators
          wrote on 12 Jul 2023, 03:36 last edited by
          #4

          @Magicrafter13 Can you please show us a screenshot of the following?

          • "Edit" > "Preferences..." > "Kits" > "Qt Versions"
          • "Edit" > "Preferences..." > "Kits" > "Kits"

          Also, how did you install Qt and Qt Creator?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          M 1 Reply Last reply 12 Jul 2023, 21:11
          0
          • J JKSH
            12 Jul 2023, 03:36

            @Magicrafter13 Can you please show us a screenshot of the following?

            • "Edit" > "Preferences..." > "Kits" > "Qt Versions"
            • "Edit" > "Preferences..." > "Kits" > "Kits"

            Also, how did you install Qt and Qt Creator?

            M Offline
            M Offline
            Magicrafter13
            wrote on 12 Jul 2023, 21:11 last edited by Magicrafter13 7 Dec 2023, 21:14
            #5

            @JKSH

            9fa9ab9e-6ae5-4fa4-ab0a-83c3a6d263bc-image.png

            430cd080-05bd-43b3-97cb-56ff95b812eb-image.png

            I didn't personally install Qt (that I remember), I believe they were just dependencies for packages in my system. Qt Creator was installed via the package manager (as I assume Qt versions automatically were as well).

            I'm on Manjaro Linux (Arch).

            Edit:
            Oh, when I opened the project today it was fine. It must be when I switched the Desktop kit to use Qt 6.5.1 that it didn't apply that change until I reopened Qt Creator, but everything seems to be fine now...

            1 Reply Last reply
            0
            • M Magicrafter13 has marked this topic as solved on 12 Jul 2023, 21:14

            1/5

            10 Jul 2023, 02:03

            • Login

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