[Kde-games-devel] KGoldrunner problem in Windows

Ian Wadham ianw2 at optusnet.com.au
Mon Dec 24 00:36:51 CET 2007


On Mon, 24 Dec 2007 02:10 am, Christian Ehrlicher wrote:
> Ian Wadham schrieb:
> > On Sat, 22 Dec 2007 09:28 pm, Christian Ehrlicher wrote:
> >> And regarding your kgoldrunner problem - looks like someone forgot to
> >> read the QPainter docu. I really wonder why it worked on linux ... :)
> >
> > So what does this mean, Christian?  And what are you implying? ... :-)
>
> Just take a look on my last checkin to fix the problem. And see what
> QPainter::begin() and :end() is for :)
>
Well, it's Christmas and your name is Christian, so I'll forgive you this
time, but in future please do not make this kind of comment about
someone you do not know, especially not on the SVN record ... :-)

Yes, I do RTFM and so does Luciano ... and no, you do not need
QPainter::begin() and :end() if you use the constructor with a
QPaintDevice * parameter and the (auto) destructor ... as the doco
says and the doco examples show.  Furthermore, there are dozens
of usages of QPainter(QPaintDevice * device) elsewhere in KDE
Games code, without begin() and end(), and they work very well
in Linux and AFAIK in Windows too.

So I think you have turned up some kind of discrepancy in the
Windows implementation of QPainter, which forces you to use
begin() and end() in this case.

I thought it might be because the QPainter and QImage are used
and re-used repeatedly, in a loop.  Your begin() and end() are inside
the loop, essentially giving you a fresh QPainter each time.  But no,
KJumpingCube also uses a loop with no begin() or end().  So I am
puzzled by this.

Maybe the trouble is the order in which the QPainter is constructed
and the QImage rectangle is adjusted (in the original code, that is).

All the best and Merry Christmas, Ian W.




More information about the Kde-windows mailing list