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