Infinite canvas issues

Cyrille Berger cberger at cberger.net
Tue Jun 30 19:50:17 CEST 2009


On Tuesday 30 June 2009, LukasT.dev at gmail.com wrote:
> Hi,
>
> I implemented infinite canvas and now I need to fix related issues.
Cool :)

> The one I don't know much about is about "painting preview". Is it correct
> name for it? When you paint, you see what you paint and just small update
> rectangle is updated. You can watch my problem on video[1]. I tested the
> updating using kwin and its "Show paint" effect but the whole canvas is
> updated in Krita. Could you direct me to the code? It is in paintEvent of
> the QPainterCanvas? ev->rect? I tried that but without luck (I moved that
> rect but I did not see what i painted until i scrolled with wheel to
> generate event and have updated widget)
Well. Update of a widget is made by a call to "QWidget::update()", and are the 
actual painting is executed later when the control go back to the execution of 
the main loop. This make the updating more efficient, since (among other things) 
Qt can merge multiple update in a single update, but this makes it much more 
difficult to trace since there is no direct connection during the actual widget 
painting and whatever triggered it. So the only way is to track call to 
"QWidget::update()", either by grepping in the code, or setting a breakpoint 
in gdb.

-- 
Cyrille Berger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20090630/c9b3e3a1/attachment.htm 


More information about the kimageshop mailing list