I get he impression that Qgrapchiscene and Qgrapchisview are sometimes redundant ?
At diagramscene example I see :
Code:
scene->update();
view->update();
I also see :
The model-view applied to this is some confused.....
It is as the two objects were sharing something ....
Who is the responsible of draw ?
Can I create a mix - object ? (On object with the mixed of both)
Is it possible ? It is a bad - good idea ?
Any explication?
Thanks
Re: I get he impression that Qgrapchiscene and Qgrapchisview are sometimes redundant
Quote:
Who is the responsible of draw ?
The view is the only thing doing any drawing. As the QGraphicsScene docs say:
Quote:
Note that QGraphicsScene has no visual appearance of its own; it only manages the items. You need to create a QGraphicsView widget to visualize the scene.
Mouse events on the view are translated into their equivalent event in the scene and forwarded, which is why the scene has these events.
Quote:
Can I create a mix - object ? (On object with the mixed of both)
You have to have a scene and a view (or views) somewhere. If they are both member variables of, for example, the main window class then that makes sense (but is not mandatory).