[Kde-games-devel] KGoldrunner problem in Windows

Ian Wadham ianw2 at optusnet.com.au
Mon Dec 24 13:11:31 CET 2007


On Mon, 24 Dec 2007 09:36 pm, Christian Ehrlicher wrote:
> Ian Wadham schrieb:
> > ... 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.
>
> It's not a discrepancy, it's documented that you need to call begin()
> when you begin painting to a QPaintDevice and you've to call end() when
> you finished. And only after end() the QPaintDevice is in a consistent
> state. It just by accident that it works on linux.
>
I can only think that you and I must be looking at different doco.

My doco clearly says, more than once, that you do not need to use
begin() and end(): you can use the constructor and destructor to do
begin() and end() automatically.  And it only says (rather vaguely) that
begin() "activates" or "begins" the painter and end() "deactivates" or
"ends" it and "releases resources" ... nothing about consistent states.

AFAICS there is nothing to say you cannot clear a QPaintDevice and
paint on it over and over, between begin() and end().

My reference is Qt Reference Documentation (Open Source Edition)
Qt 4.3.2 (obtained from the qt-copy in KDE's SVN repository), QPainter
Class Reference.  What doco are you referring to, Christian?

BTW are other KDE games working in Windows without this begin/end
mod?  How about KJumpingCube, the other game I maintain?

All the best, Ian W.



More information about the Kde-windows mailing list