Qt 5 Styling: dynamically load qml files
问题 I am currently trying to extend our application with different style. For each style I have a separate qml file with e.g. color definitions. StyleA.qml: import QtQuick 2.0 QtObject { property color textColorStandard: 'black' ... } In my main.qml I would like to load the right qml file, based on a software property: import QtQuick 2.0 Item { id: mainPanel .... Loader { id: myDynamicStyle source: Property.UseThemeA? "StyleA.qml" : "StyleB.qml" } ... Item { id: BackGround color: myDynamicStyle