keshav2010
26th March 2018, 16:52
Hello, I'm making a very small 2D animation software which basically allows the user to import images from pc and then render them on a specific location.
I'm using Qt's Graphics View Framework, the QGraphicsView is being used for displaying each frame of animation.
The frame itself inherits QGraphicsScene, now this frame class also contains a list of objects to render.
Now, I have multiple frames, which are being displayed on QGraphicsView, but the problem is my frame's drawBackground() or drawForeground() functions which I implemented aren't being called automatically unlike QGraphicsView's drawBackground() method.
Can you please help me what I'm doing wrong, till I get some concrete solution, I'm following this approach
Inside of my QGraphicsView's drawForeground() method, in executing this statement so as to update my frame repeatedly
scene()->render(painter, sceneRect(), sceneRect() );
this is working but I just don't understand why I need to call render() and why not QGraphicsScene::drawForeground() is not being called automatically.
I'm using Qt's Graphics View Framework, the QGraphicsView is being used for displaying each frame of animation.
The frame itself inherits QGraphicsScene, now this frame class also contains a list of objects to render.
Now, I have multiple frames, which are being displayed on QGraphicsView, but the problem is my frame's drawBackground() or drawForeground() functions which I implemented aren't being called automatically unlike QGraphicsView's drawBackground() method.
Can you please help me what I'm doing wrong, till I get some concrete solution, I'm following this approach
Inside of my QGraphicsView's drawForeground() method, in executing this statement so as to update my frame repeatedly
scene()->render(painter, sceneRect(), sceneRect() );
this is working but I just don't understand why I need to call render() and why not QGraphicsScene::drawForeground() is not being called automatically.