[Interest] QML. onPaint is called when Canvas is invisible

Dmitrii Volosnykh dmitrii.volosnykh at gmail.com
Tue Nov 18 09:54:08 CET 2014


Thank you for sorting this out.

Regards,
Dmitrii.

2014-11-18 11:49 GMT+03:00 <jensbw at gmail.com>:

>
> > On 16 Nov 2014, at 14:21, Dmitrii Volosnykh <dmitrii.volosnykh at gmail.com>
> wrote:
> >
> > Is such a behaviour is correct or this should be considered as a bug?
> >
> > onPaint handler gets triggered on requestPaint() and
> markDirty(Qt.rect(0, 0, width, height)).
> >
> > "if (!visible) return" guard works as a workaround.
>
> Hi Dmitrii, it is indeed intended behavior so I am rejecting that task.
>
> There are several scenarios where you wan’t canvas to allow a repaint even
> while hidden so we cannot make such assumptions. I.e prepare content before
> it is shown on screen, using a canvas as an image source for another canvas
> or even reading out pixels values directly from the buffer without ever
> showing it on screen. A canvas is also a data structure and it’s visibility
> is not related to actual contents. Your workaround would be a good way of
> handling it provided you know that none of the above scenarios apply to you.
>
> Regards,
> Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141118/9272930c/attachment.html>


More information about the Interest mailing list