[Kde-games-devel] Questions about porting kolf

Dmitry Suzdalev dimsuz at gmail.com
Thu Nov 9 19:00:31 CET 2006


Hi Paul!
On Thursday 09 November 2006 00:11, Paul Broadbent wrote:
> However, I've looked around the kolf code and I can't find any times where
> QCanvasItem::move() is reimplemented. Thats assuming I have the correct
> understanding of what reimplementation is, am I right in thinking it is
> when you redefine a function to modify what it normally does? So if move
> had been reimplemented then running "grep move\( *h" from the kolf
> directory would return something? If kolf does not reimplement
> QCanvasItem::move() then I think that changing it to use
> QGraphicsView::setPos() should be fairly straightforward.
Well I told you wrong :).
That's not QCanvasItem::move(), that's QCanvasItem::moveBy().
And it gets overriden many times.

But as Pino pointed me on IRC QGraphicsItem has itemChange() function which is 
virtual, can be overriden, and can be used to replace moveBy() so you're 
lucky :-). Take a look at it.

Cheers,
Dmitry.


More information about the kde-games-devel mailing list