I should start by saying I've tried to look at this problem from all POVs. I've also asked on freenode and I was suggested some things, yet in the end it turned out those suggestions could not possibly work.
It looked to me as though those making suggestions don't really know how the class hierarchy and the concepts hierarchy looks like.
That being said, I haven't used Qt for years, so please bear with me.
What I want to make is a graphics item (QGraphicsWidget,...Item, whatever, I don't know what class it should inherit from) that can sit on the scenery QGraphicsScene.
Imagine you wanted to create a reusable component for grid-based games like battleship.
New objects (like a battleship) within this widget could be represented as bit matrices and created/inserted on the fly.
The building blocks themselves (filled QGraphicsRectItem or "empty" ones) inside it should be managed by a layout class. As a default could serve QGraphicsGridLayout, but it should allow plugging in a custom layout. This would allow new 2D layouts, like isometric.
Having a layout inside the widget would also simplify game development on top of this widget, as you'll have methods itemAt() and layers to organize the objects on the "grid".
And remember, the widget itself can sit inside the scenery.
So which concepts (grid widget, grid block, grid layout) should inherit from which qt4 (4.7.2) classes?
Note: already exiting classes/frameworks/whatever are also OK, but keep in mind I don't want to have to distribute libraries thicker than 3-4 Mb for windows users.
Bookmarks