Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Compiling QML files with different Qt versions...
Qt 6.11 is out! See what's new in the release blog

Compiling QML files with different Qt versions...

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 488 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by Francky033
    #1

    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.15

    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

    If I remove the version numbers of the modules, like this :

    import QtQuick
    import QtQuick.Window
    import QtQuick.Controls
    import QtQuick.Controls.Material

    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)

    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 VAR

    Thank you!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved