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

Time:09-02

I'm running ubuntu 20.04.3, and have installed qt 5.12.8 packages 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]

I assume that "5.12.8" refers to the Qt version, not the QtQuick.Controls version. This page indicates that QtQuick.Controls version 2.12 comes with Qt 5.12. However "import QtQuick.Controls 2.12" 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!

CodePudding user response:

You should install qml-module-qtquick-controls2 not qml-module-qtquick-controls. That should fix your issue.

  • Related