Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What version of QtQuick.Controls is installed on my ubuntu system?
Forum Updated to NodeBB v4.3 + New Features

What version of QtQuick.Controls is installed on my ubuntu system?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 6.1k 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.
  • T Offline
    T Offline
    Tom asso
    wrote on 31 Aug 2022, 21:44 last edited by Tom asso
    #1

    I'm running ubuntu 20.04. 3, and have installed qt 5.12.8 components with 'apt'.
    I install QtQuick.Controls with:

    sudo apt-get install qml-module-qtquick-controls
    

    I need to know which version of QtQuick.Controls is installed, because if my qml file contains this:

    import QtQuick.Controls
    

    I get a runtime error:

    qrc:/main.qml:-1 Library import requires a version
    

    Now how do I know which version of QtQuick.Controls is installed?

    apt list --installed | grep qtquick-controls
    qml-module-qtquick-controls/focal,now 5.12.8-0ubuntu2 amd64 [installed]
    

    This seems to say QtQuick.Controls 5.12.8 is installed. But if my qml contains this:

    import QtQuick.Controls 5.12.8
    

    I get this runtime error:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:4 Expected token `;'
    

    So it seems the '.8' suffix is not allowed. I put this in my qml file:

    import QtQuick.Controls 5.12
    

    I get this runtime error:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:4 module "QtQuick.Controls" version 5.12 is not installed
    

    EDIT: This page indicates that QtQuick.Controls version 2.12 comes with Qt 5.12. However "import QtQuick.Controls 2.12" also results in this error at runtime:

    qrc:/main.qml:4 module "QtQuick.Controls" version 2.12 is not installed
    

    Can someone please help me sort this out? Thanks!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tom asso
      wrote on 1 Sept 2022, 16:41 last edited by
      #4

      I also asked this question on stackoverflow.com, and got this response:
      "You should install qml-module-qtquick-controls2 not qml-module-qtquick-controls" - now the runtime finds "import QtQuick.Controls 2.12" as expected

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on 1 Sept 2022, 02:22 last edited by
        #2

        2.12 should be correct.
        Do you have the Qt Declarative module installed?

        T 1 Reply Last reply 1 Sept 2022, 16:37
        0
        • C ChrisW67
          1 Sept 2022, 02:22

          2.12 should be correct.
          Do you have the Qt Declarative module installed?

          T Offline
          T Offline
          Tom asso
          wrote on 1 Sept 2022, 16:37 last edited by
          #3

          @ChrisW67 - Yes, apt packages qtdeclarative5-dev and qtdeclarative5-dev-tools are both installed.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tom asso
            wrote on 1 Sept 2022, 16:41 last edited by
            #4

            I also asked this question on stackoverflow.com, and got this response:
            "You should install qml-module-qtquick-controls2 not qml-module-qtquick-controls" - now the runtime finds "import QtQuick.Controls 2.12" as expected

            1 Reply Last reply
            0

            1/4

            31 Aug 2022, 21:44

            • Login

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