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?

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

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 7.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.
  • Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on 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
    • Tom assoT Offline
      Tom assoT Offline
      Tom asso
      wrote on 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 last edited by
        #2

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

        Tom assoT 1 Reply Last reply
        0
        • C ChrisW67

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

          Tom assoT Offline
          Tom assoT Offline
          Tom asso
          wrote on last edited by
          #3

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

          1 Reply Last reply
          0
          • Tom assoT Offline
            Tom assoT Offline
            Tom asso
            wrote on 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

            • Login

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