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. module "QtQuick.Controls" version 2.2 is not installed

module "QtQuick.Controls" version 2.2 is not installed

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 6 Posters 25.7k 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.
  • Z Offline
    Z Offline
    Zlamir
    wrote on last edited by
    #1

    Hi, i'm new to Qt and i was following this video tutorial to make a simple to do list app.
    In that video, a Qt Quick Controls 2 Application is created, but i noticed was that in my QtCreator version that option was not available.
    So, the apparent solution was to import the required prerequisites given by the official documentiation:

    • import QtQuick.Controls 2.2 .qml file.
    • #include <QtQuickControls2> in the .cpp file.
    • QT += quickcontrols2 in the .pro file.

    The thing is when i try tu run it i get the error:

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

    Also i think 'm using the right versions of each module according to the docs:

    • Qt: 5.9
    • QtQuick: 2.9
    • QtQuickControls: 2.2

    I appreciate any help or advice.

    1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      Change the import statement in .qml file to 2.1 instead of 2.2

      `import QtQuick.Controls 2.1`
      

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zlamir
        wrote on last edited by
        #3

        It throws the same error but now asking for the version 2.1.

        1 Reply Last reply
        0
        • eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by eyllanesc
          #4

          @Zlamir How did you install Qt?

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            Zlamir
            wrote on last edited by Zlamir
            #5

            Well, i didn't found an official installing guide for Ubuntu 18.04 so i followed this one.
            The steps to install QtCreator were basically:

            sudo apt install build-essential
            sudo apt install qtcreator
            sudo apt install qt5-default
            

            Then, to use QtQuickControls i was missing some dependencies that i had to install mannually through running:

            sudo apt install qtdeclarative5-dev
            sudo apt install libgles2-mesa-devqtquickcontrols2-5-dev
            sudo apt install qtquickcontrols2-5-dev
            

            PD: Sry for the late response but i was a little busy with new year stuff.

            1 Reply Last reply
            1
            • Kiranachari ShilpiK Offline
              Kiranachari ShilpiK Offline
              Kiranachari Shilpi
              wrote on last edited by
              #6

              Hi @Zlamir ,
              Here is the link goes to the QtCreator downloads ,
              It supports Ubuntu, Linux platforms , try to download and Install .

              1 Reply Last reply
              1
              • Z Offline
                Z Offline
                Zlamir
                wrote on last edited by
                #7

                Thank you! Installing from the official source actually solved the issue.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kirsten
                  wrote on last edited by Kirsten
                  #8

                  Hi,
                  I'm using QT_VERSION 5.9.5, both qtdeclarative5-dev and qtquickcontrols2-5-dev are already the newest version (5.9.5-0ubuntu2).
                  Also added those lines in cpp, qml and pro file as Zlamir mentioned, but still getting the "module "QtQuick.Controls" version 2.2 is not installed" error.

                  What else should I check?

                  Edit: Funny thing - switching to QtQuick.Controls 1.4 works..

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Alexei.K
                    wrote on last edited by
                    #9

                    Bug fix for Debian 10 and default Qt5.11:
                    sudo apt install qml-module-qtquick-controls2

                    1 Reply Last reply
                    1

                    • Login

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