[Kde-games-devel] Port of KMahjongg

Albert Astals Cid aacid at kde.org
Wed Aug 1 18:09:46 UTC 2012


El Diumenge, 22 de juliol de 2012, a les 21:47:14, Christian Krippendorf va 
escriure:
> Hey guys,
> 

Let me be the evil guy, what's the benefit of this port?

> the port of kmahjongg is now done in many ways. Just few bugs are out
> there, but that should be solved quickly for me. My question now following:
> 
> Can please anyone review my code out of the design? This is my first
> port to QGraphics-Framework and i'm really not sure if i had done all
> design things right. Maybe some functionallity should be in another
> class etc. etc. Just code design things.
> 
> The branch is branches/work/krippendorf the mainly affected files are:
> 
> GameItem.h/cpp - QGraphicsItem
> GameView.h/cpp - QGraphicsView
> GameScene.h/cpp - QGraphicsScene

public QObject, public QGraphicsItem
  you probably want just
public QGraphicsObject

The main design problem i see is the typical one in which you make your Item 
also be your Model, i.e. you are storing the gridpos in GameItem that is both 
your "logical" model and your "phisical" representation (the QGraphicsItem), 
usually it is better to have this separated, so you can throw away 
QGraphicsItem and put there MegaCoolStuff without having to change your model. 
Not sure if i'm making sense here.

> Cause before i finished, i would have a short feedback. Surely cause of
> code style and some bugs i will start a code review on the review board
> later. This should just be a short and simple code design question.
> 
> I hope i filled up the right classes with the right functionality :-).

I know you asked for "code design" stuff, but after installing kmhajongg from 
your branch all i get is an empty gray box that crashes when i press the "new" 
toolbar button.

Cheers,
  Albert

> 
> Thx in advance. Greedings.


More information about the kde-games-devel mailing list