[Kde-games-devel] Review Request: Porting KBounce to QGraphics
Roney Gomes
roney477 at gmail.com
Sat May 19 12:20:43 UTC 2012
> On May 19, 2012, 7:23 a.m., Ian Wadham wrote:
> > /trunk/KDE/kdegames/kbounce/board.h, lines 46-47
> > <http://svn.reviewboard.kde.org/r/6950/diff/2/?file=48003#file48003line46>
> >
> > I am in some confusion here as to who is the (Qt) parent or owner of the KBounceBoard in the new code. Also I think you will find that QGraphicsItem and QGraphicsItemGroup are already descended from QObject, so no need to inherit QObject.
KBounceBoard has no parent. It happens because it is a top level item and top level items doesn't need a parent, they are just elements of the scene.
It may occur, however, that in some situations the scene is treated as the parent of top level items. It is better explained in the following excerpt I took from [1]:
"At item's position is the coordinate of the item's center point in its parent's coordinate system; sometimes referred to as parent coordinates. The scene is in this sense regarded as all parent-less items' "parent". Top level items' position are in scene coordinates."
In this case KBounceGameWidget has a pointer to a KBounceBoard object which is created and added to the scene when KBounceGameWidget's constructor is called.
Regarding your second point, you can see here [2] that QGraphicsItem is not a descendant of any other class.
[1] http://qt-project.org/doc/qt-4.8/graphicsview.html
[2] http://qt-project.org/doc/qt-4.8/qgraphicsitem.html
> On May 19, 2012, 7:23 a.m., Ian Wadham wrote:
> > /trunk/KDE/kdegames/kbounce/wall.h, line 82
> > <http://svn.reviewboard.kde.org/r/6950/diff/2/?file=48007#file48007line82>
> >
> > I do not think wallBoundingRect() is used anywhere now.
You're right. The new diff I'm uploading fixes it.
- Roney
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6950/#review10799
-----------------------------------------------------------
On May 19, 2012, 12:20 p.m., Roney Gomes wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6950/
> -----------------------------------------------------------
>
> (Updated May 19, 2012, 12:20 p.m.)
>
>
> Review request for KDE Games.
>
>
> Description
> -------
>
> Following the timeline defined in my proposal, here is the port of the first game.
>
>
> Diffs
> -----
>
> /trunk/KDE/kdegames/kbounce/ball.h 1295688
> /trunk/KDE/kdegames/kbounce/ball.cpp 1295688
> /trunk/KDE/kdegames/kbounce/board.h 1295688
> /trunk/KDE/kdegames/kbounce/board.cpp 1295688
> /trunk/KDE/kdegames/kbounce/gamewidget.h 1295688
> /trunk/KDE/kdegames/kbounce/gamewidget.cpp 1295688
> /trunk/KDE/kdegames/kbounce/wall.h 1295688
> /trunk/KDE/kdegames/kbounce/wall.cpp 1295688
>
> Diff: http://svn.reviewboard.kde.org/r/6950/diff/
>
>
> Testing
> -------
>
> I observed the game under the following conditions:
> - Before the first match
> - During a match
> - Closing a match
>
>
> Thanks,
>
> Roney Gomes
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120519/de0c0818/attachment.html>
More information about the kde-games-devel
mailing list