[Kde-games-devel] KGoldrunner problem in Windows

Ian Wadham ianw2 at optusnet.com.au
Mon Dec 24 21:57:26 CET 2007


On Mon, 24 Dec 2007 10:44 pm, Christian wrote:
> QPainter::end() flushes all internal buffers and
> therefore it's needed to make sure all is painted before 
> accessing a QImage/QPaintDevice.
>
If only the documentation had said that ... ;-)  It is written as though
QPainter operations are synchronous and end() is just housekeeping.

> I'm now looking to all kde games to see if there're other places where
> QPainter is used wrong. katomic (e.g. katomicrenderer.cpp) is correct.
>
Chances are there will be some.  The implementation of themes in our
games is to repeatedly render SVG elements into scaled QImages, then
convert them to QPixmaps.  The QPixmaps are painted on the screen
later, by QGraphicsView, another QPainter or whatever.

I glanced at a few last night, but it was getting late, on Christmas Eve.

It seems as though KMahjongg and KShisen are correct.  They put the
rendering of each element inside a function or "if" block, so the
QPainter should be created/destroyed for each SVG element rendered,
with auto begin() and end(), but maybe in some cases the conversion
to QPixmap occurs just before the QPainter is destroyed.

To be certain, I would need to run the code in Windows and I cannot
do that, yet.

Would you like to alert the kde-games-devel list to this problem,
so each guy can check his own code?  Or would you like me to?

Thanks for clarifying.  Have a Happy Christmas, Ian W.




More information about the Kde-windows mailing list