Unsolved QML Conditionaly import
-
Hi; How can I like this:
import ... switch (Qt.platform.os) { case "linux": import QtQuick.Controls 1.4 break case "android": import Qt.labs.controls 1.0 break }
Thanks.
-
IMHO best is to use separate QML files and file selectors (https://doc-snapshots.qt.io/qt5-5.7/qqmlfileselector.html) to choose between them. QQmlApplicationEngine has a built-in file selector installed, so all you need is to structure your files into appropriate '+' folders.