[Interest] How to do a correct drop shadow on a QML Rect?

Ben Lau xbenlau at gmail.com
Fri Feb 6 05:10:46 CET 2015


Hi Jason,

Here is an example to attach shadow in material design style to rectangle
object:

https://github.com/benlau/quickandroid/blob/master/QuickAndroid/Shadow.qml



On 6 February 2015 at 12:01, Jason H <jhihn at gmx.com> wrote:

> These flat interfaces are all the rage these days. So I want to make a
> drop shadow. However the two approaches I can think of don't work.
>
> First is the QML DropShadow element. This creates a shadow of a constant
> color when the source is a rect. It is pixel-equivalent to just another
> Rect, so that is out.
>
> The next is doing my own drop shadow by using 2 Rect with a gradient.
> (horizontal + vertical) This will render a continuous gradient (good) but
> won't do the bottom right corner. You can either double blend it, or skip
> it. Either way, it doesn't look right.
>
>
> So is there a way to shadow a rect?
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150206/5ef4651e/attachment.html>


More information about the Interest mailing list