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

ekke ekke at ekkes-corner.org
Sun May 8 14:36:40 CEST 2016


Am 08.05.16 um 13:50 schrieb Nikita Krupenko:
> 2016-05-08 13:59 GMT+03:00 ekke <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
> It depends on what part you share and what is specific. It could be
> the other way, that you have mostly identical resources for different
> styles, but all highly os-specific. Then you can place it in
> os-specific folder and in some cases select proper image for current
> style using ?: expression.
>
>> as Google does this for Material icons: android
>> versions getting _black for light theme and _white for dark theme
> In most cases you need white icons for the app bar and other icons are
> tinted with some color, so you can just use white icons :)
using uncolored Icons outside app bar with light theme, I have to use
black image with opacity 0.38 -
with dark theme need white image with opacity 0.50
so it would be helpful to have black and white images -
I think, it's cheaper to have different images for black and white as to
tint per ex white images with black.

thanks for your input - have to carefully think about to find the best
structure for my common customer projects

ekke
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>




More information about the Interest mailing list