[Interest] Qt 5.7 - Using File Selectors with Qt Quick Controls 2

J-P Nurmi jpnurmi at qt.io
Tue May 10 16:46:37 CEST 2016


On 08 May 2016, at 14:36, ekke <ekke at ekkes-corner.org<mailto:ekke at ekkes-corner.org>> wrote:

Am 08.05.16 um 13:50 schrieb Nikita Krupenko:
2016-05-08 13:59 GMT+03:00 ekke <ekke at ekkes-corner.org<mailto:ekke at ekkes-corner.org>>:
what if (per ex. for a demo app) user can switch between universal and
material and using some images specific to universal, others to material and
this in combination with ios and android - is this possible via file
selector or will it only work for one style per platform.
You can place style-specific images into separate folders and if you
have some different images in style for os you can check
Qt.platform.os and select the appropriate image:
https://doc.qt.io/qt-5/qml-qtqml-qt.html#platform-prop
For example, you have:

+material/img_ios.png
+material/img_android.png

Image {
   source: Qt.platform.os === "ios" ? "img_ios.png" : "img_android.png"
}
thanks


Hi,

Notice that you can combine file selectors, for example:
- img.png // the base image must always exist
- +material/img.png // used with the material style, except on ios
- +material/+ios/img.png // used with the material style on ios

--
J-P Nurmi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160510/9fa2acf6/attachment.html>


More information about the Interest mailing list