[SOLVED] Is exist fututre plans for supproting tech like qss in qml?
-
Hi all!
I interested in this because I don't understand how I can create several designs for several platforms in my app.
I don't want to create several projects for each platform, I want to load predefined design in compilation time.
And also I don't want create different qml files.I already read this topic "http://qt-project.org/wiki/QmlStyling":http://qt-project.org/wiki/QmlStyling , but this not provide what I need because I don't can change singleton qml file in compilation time.
Is exist any ways or is will be?
Thank you for your attention!
-
There are two mechanisms that you can already make use of to do this.
As for your style, I would suggest you create multiple versions of a file called something like Constants.qml, containing properties like marginWidth, titleColor, baseColor, buttonPixmap etc.Then you can load this into your application on a per-platform basis, by either creating a loader:
@
Loader {
source: switch(Qt.platform.os) {
case "android: ...
case "windows: ...
}
@
etcOr alternatively, with Qt 5.2 there are new platform selectors that allows ou to build multiple versions of your application with specific file names/directories for different platforms: