[Qt-qml] env variable expansion in import, useful for styles?

warwick.allison at nokia.com warwick.allison at nokia.com
Tue Apr 27 04:18:16 CEST 2010


> -----------Button.qml-----------
> import "$STYLE"
> Button{}
> --------------------------------

Environment variables are notoriously cumbersome to set - especially hard if you want to set it for already-running processes!

Note that you can achieve styling in multiple ways already, without this, if somewhat more cumbersome ways. For example, using Loader based on a single string gotten via SQL or XmlListModel.
 
Personally, I hate the particular kind of "styling" this allows. A UI should be designed as a beautiful working whole, not a pile of abstractions that have to work regardless of what junk someone else writes later.

Also note that Theming was explicitly discarded as a use case for the requirement (see QT-558). By me though, so that's no stronger argument against ;-)

--
Warwick
Ps. if you must, you'll need "${STYLE:-mydefaultstyle}".




More information about the Qt-qml mailing list