What version of QtQuick.Controls is installed on my ubuntu system?
-
wrote on 31 Aug 2022, 21:44 last edited by Tom asso
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!
-
wrote on 1 Sept 2022, 16:41 last edited by
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 -
wrote on 1 Sept 2022, 02:22 last edited by
2.12 should be correct.
Do you have the Qt Declarative module installed? -
wrote on 1 Sept 2022, 16:41 last edited by
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/4