Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What is the magic decoder ring for matching library versions in QML?
PJM4B last edited by
I'm a novice to QML and have been having trouble grokking the library versions and properties in the QML framework.
Which version of various libraries do I use? If I grep the examples directory I get something like this:
pmoran@EB840PMORAN MINGW64 /c/Qt/Examples/Qt-5.10.1 $ grep -r QtQuick.Controls . | cut -d ':' -f4 | sort -u qputenv("QT_QUICK_CONTROLS_1_STYLE", " import QtQuick.Controls.Material 2.1 /ExtrasImports/QtQuick/Controls/Styles/Flat"); \printuntil import QtQuick.Controls 2.1 Binary file ./datavisualization/build-qmlsurface-Desktop_Qt_5_10_1_MinGW_32bit-Debug/debug/qmlsurface.exe matches Binary file ./datavisualization/build-qmlsurface-Desktop_Qt_5_10_1_MinGW_32bit-Debug/debug/qrc_qmlsurface.o matches import QtQuick.Controls 1.0 import QtQuick.Controls 1.0 as Controls import QtQuick.Controls 1.1 import QtQuick.Controls 1.2 import QtQuick.Controls 1.4 import QtQuick.Controls 1.4 as Controls import QtQuick.Controls 1.5 import QtQuick.Controls 2.0 import QtQuick.Controls 2.0 as C2 import QtQuick.Controls 2.0 as QQ2 import QtQuick.Controls 2.0 as QQC2 import QtQuick.Controls 2.1 import QtQuick.Controls 2.1 as QQC2 import QtQuick.Controls 2.2 import QtQuick.Controls 2.3 import QtQuick.Controls.Imagine 2.3 import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material 2.1 import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0 as QQCPrivate import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.3 import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles.Flat 1.0 as Flat import QtQuick.Controls.Universal 2.1
As you can see I get QtQuickControl version 1.0, 1.1, 1.4, 1.5, 2.0, 2.1, 2.2, 2.3. How do I mix and match components?
For new projects. use QtQuick.Controls version 2 as their performances are way better than the version 1. You can mix both if the control you need is not available in QtQuick.Controls 2.
Otherwise it boils down to the minimal version that provides the features you need and the compatibility you want.
PJM4B last edited by
I think my question wasn't formulated correctly.
I am wondering how to match the correct versions of libraries.
For example how would I know that these libraries all go together?
import QtQuick 2.1
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import QtQuick.Window 2.3
import QtQuick.Scene3D 2.0
You can see that in the documentation of the types you are using.