QML_IMPORT_PATH/QML2_IMPORT_PATH shared by Qt5 & Qt6 results in conflicts
Open, Needs TriagePublic

Description

  • both Qt5 & Qt6 consider QML2_IMPORT_PATH and QML_IMPORT_PATH
  • the QML modules have no indicator whether they are for Qt5 or Qt6

As result it seems both Qt5 and Qt6 pick just based on the module name whatever they find first, ignoring if it is for a compatible Qt version.

Example:"import org.kde.kirigami": if there is any Kirigami module of either KF5 or KF6 in a path listed in QML2_IMPORT_PATH, things will work by chance if the Qt versions match or not.

Things work fine if all the modules are installed into the Qt system prefix, as Qt5 will not look into Qt6 QMLmodules subdir and vice versa.
But once things are installed into custom prefix and thus the env vars need to be used, there is chaos.

Might also not be an issue for bundled/containered apps that get their own set of tailored env vars.

But issue for people who put QML_IMPORT_PATH/QML2_IMPORT_PATH e.g. into their .bashrc for user-specific installations on shared non-containered systems.

kossebau created this task.Jun 20 2023, 2:53 PM