PDA

View Full Version : QGraphicsScene's sceneRect() doesn't update



blooglet
17th February 2011, 09:53
I've inherited from QGraphicsScene to implement my own event handlers for mousePressEvent, mouseMoveEvent and mouseReleaseEvent. When I draw onto the graphics scene, the sceneRect doesn't update. I assume that's because I made my own event implementations and they don't do some of the stuff that the default implementations do handle. What am I missing?

stampede
17th February 2011, 10:06
(...) and they don't do some of the stuff that the default implementations do handle. What am I missing?
Looks to me like you've already answered your question :)


When I draw onto the graphics scene, the sceneRect doesn't update
Post the drawing code.

blooglet
17th February 2011, 10:11
Post the drawing code.
I would, except that I'm working on a class project where I'm not allowed to share my code with others. I can tell you however that none of my mouse event handlers call their default implementation if a shape is being drawn on the scene. I don't know if that poses a problem.

Here's something else I found... Should I use

void setSceneRect ( qreal x, qreal y, qreal w, qreal h )
to alter the scene rectangle when necessary or is there a cleaner way to go about doing this?