Compiling QML files with different Qt versions...
-
I would like to compile an application with Qt 5.15.5 or Qt 6.5.0.
I have qml files that contain imports like:
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15The compilation works with both versions of Qt, but it blocks the compilation under Qt 6.5.0 to the version 2.15 of these qml modules
If I remove the version numbers of the modules, like this :
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.MaterialThis compiles well under Qt 6.5.0 but generates errors under Qt 5.15.5 (because module imports had to have a version number)
How to solve this problem?
Would it be possible to define a kind of "defined" (VAR for example) allowing to set VAR to 2.15 or VAR to "" depending on the version of Qt I use for the compilation ?
import QtQuick VAR
import QtQuick.Window VAR
import QtQuick.Controls VAR
import QtQuick.Controls.Material VARThank you!