[Interest] QML: support both Qt5 and Qt6

Alexander Dyagilev alervdvcw at gmail.com
Tue Sep 7 22:13:24 CEST 2021


We would like to migrate to Qt6. However, we still need to be able to 
build our project with Qt5 to continue supporting Windows 7 OS (15% of 
our users are still using it).

For now, I've managed to make C++ part support both Qt6 and Qt5.

However, it seems that QML part is not so easy.

For example, we do use MessageDialog component. In Qt5, it requires 
import QtQuick.Dialogs 1.3, and in Qt6 - import Qt.labs.platform 1.1.

Is it possible to import different modules depending on the current Qt 

More information about the Interest mailing list