<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Compiling QML files with different Qt versions...]]></title><description><![CDATA[<p dir="auto">I would like to compile an application with Qt 5.15.5 or Qt 6.5.0.</p>
<p dir="auto">I have qml files that contain imports like:</p>
<p dir="auto">import QtQuick 2.15<br />
import QtQuick.Window 2.15<br />
import QtQuick.Controls 2.15<br />
import QtQuick.Controls.Material 2.15</p>
<p dir="auto">The 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</p>
<p dir="auto">If I remove the version numbers of the modules, like this :</p>
<p dir="auto">import QtQuick<br />
import QtQuick.Window<br />
import QtQuick.Controls<br />
import QtQuick.Controls.Material</p>
<p dir="auto">This compiles well under Qt 6.5.0 but generates errors under Qt 5.15.5 (because module imports had to have a version number)</p>
<p dir="auto">How to solve this problem?</p>
<p dir="auto">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 ?</p>
<p dir="auto">import QtQuick VAR<br />
import QtQuick.Window VAR<br />
import QtQuick.Controls VAR<br />
import QtQuick.Controls.Material VAR</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.qt.io/topic/142784/compiling-qml-files-with-different-qt-versions</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 14:34:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142784.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Feb 2023 16:04:15 GMT</pubDate><ttl>60</ttl></channel></rss>