Important: Please read the Qt Code of Conduct -

module "QtQuick.Controls" version 2.2 is not installed

  • 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.

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

    `import QtQuick.Controls 2.1`

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

  • @Zlamir How did you install Qt?

  • 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.

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

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

  • 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..

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

Log in to reply