[Development] Forcing clipping rectangle updates for "special" geometries

Sletta Gunnar Gunnar.Sletta at digia.com
Fri Aug 9 14:51:29 CEST 2013

The patch looks sane enough. Maybe you want to put it up on codereivew.qt-project.org?


On Aug 8, 2013, at 7:59 PM, Loïc Molinari <loic.molinari at canonical.com> wrote:

> Hi,
> I'm creating a custom QQuickItem that casts a shadow around its
> geometry. In order to make it easy to use from the QML side, I made
> the shadow independent of the item size so that users can manipulate
> the item as if it doesn't have a shadow. It's easy to implement with a
> scene graph node that has its geometry defined to render outside of
> the item rectangle.
> Clipping is the only problem I have with it. By default, the clip
> rectangle is the same as the item rectangle which makes the renderer
> clip the shadow if the "clip" property is enabled. clipRect() being
> virtual I can provide my own clip rectangle, that's good but the
> problem is that clipRect() is only called when the item size changes
> or when the "clip" property is switched. I haven't found anything for
> that in QtDeclarative and thought a solution would be to provide an
> updateClipRect() method in QQuickItem that would force clipRect() to
> be called by making a dedicated flag dirty. I tested it and it works,
> the code is here [1].
> Is there a built-in solution for that? In case there's not, do you see
> a better technique than the one proposed?
> Regards,
> Loïc Molinari
> [1] http://paste.ubuntu.com/5963311/
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

More information about the Development mailing list