[Kde-games-devel] Kolf rewrite (includes important design question even for non-coders)

Aaron J. Seigo aseigo at kde.org
Fri Nov 21 00:00:27 CET 2008


On Thursday 20 November 2008, Kleag wrote:
> Having separate classes for view (QGraphicsItem) and model  (QObject) seems

technically, QGraphicsItems are not view but model objects on the 
QGraphicsScene, which is itself a model which the View visualizes.

you also don't need to separate the QGraphicsItem and the QObject (you're just 
asking for syncronization overhead); you can multiple inherit QGI and QObject 
and apply the same design strategy that was suggested. (or use QGraphicsWidget 
if that's more your game, which MI's QObject and QGraphicsLayoutItem, though 
QGW probably doesn't make much sense for a game like kolf)

a situation where i could see using separate QObject's is if the data 
contained in them is complex/expensive and can be shared across multiple 
QGI's, like a style object a layout document.

but if each object's data is both simple and likely to be unique anyways, i 
would personally skip the complication of separate QGI and QObject objects.

> I agree for the config solution, though.

yes, that seems solid.

> have more than one view of the same object, e.g. two perspectives.

i assume you aren't talking about multiple views on screen, but multiple views 
inside from a code design perspective?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20081120/dc5cb72c/attachment.sig 


More information about the kde-games-devel mailing list