I am struggling with the MVC concept.
My current design:
a subclass of
QGraphicsScene
, that implements a large number of properties:setPropertyAOnSelectedItems
/getPropertyAOfSelectedItems
setPropertyBOnScene
/getPropertyBOfScene
a subclass of
QGraphicsView
that implements a few properties (like zoom, centering, certain mouse or gesture actions)a UI containing the view and user tools to edit - set/read properties from scene
other similar UI's with different design and editing a subset of the scene properties
Reading about how to implement MVC in Qt, at the moment I have the scene subclass pretending to be one giant "model" - except it doesn't expose the kind of functions from Qt's examples... index, row and column info seems useless, and to use a data()
for the large number of complex properties seems ... not applicable (even if assigning a very large number of "roles").
The UI would be the View... That would allow multiple UIs to use the same model...
But what would be the Controller ?
Reading about "skinny" Controllers - it seems that in this situation I could have a Controller that does nothing but echoes the info from UI, to the scene, and back... And that seems useless !
Where would I put range checks/valid checks/unit conversions ? Is that the role of the controller ?
I would like to have a Validation class separate - where would that be in the MVC hierarchy ?
I have tried to read and adapt the MVC concept to my problem but I just can't see how to break it down...