PDA

View Full Version : GraphicsView/GraphicsScene does not update



robicjedi
6th June 2008, 13:41
Hi!
I have a small numerical software http://seis.bris.ac.uk/~rs1909/pdde/
that uses GraphicsView/GraphicsScene. This used to work with Qt 4.3, but does not work with v.4.4 anymore. When adding items to GraphicsScene the view does not update, only when I resize the window. I was trying to add update(sceneRect()); all over the place, but still not working. Especially the rubberband of selecting a region does not even appear when I move to mouse, while it has nicely worked with 4.3.

Does anybody know what change could have caused this behaviour? Unfortunately I cannot give a small testcase yet, that would take some time.
Bests,
Robert

robicjedi
6th June 2008, 15:23
Most surprisingly the update happens occasionally, though rarely. Is it an event loop problem, that is events do not propagate as they should? Most interestingly the rubberband shows sometimes if I am out of the plotting region, but it does not otherwise.
-R

robicjedi
25th June 2008, 15:12
I've found out the reason. The event handling for key and mouse event were buggy before Qt 4.4 so I had to reimplement QGraphicsScene::event() to handle events. In earlier versions it seemed that keyPressEvent went to /dev/null. After removing this reimplementation everything work fine again.
-R

robertson1
28th June 2008, 14:06
Hi,

I'm experiencing a similar thing.

I have reimplemented some qgraphicsview mouse events so that I can scroll around by holding down the middle mouse button (the same as qgraphicsview::ScrollHandDrag except using the middle mouse button). It worked ok up until 4.4.0 but now it is as if only some of the events get passed through.

Have enclosed an example, hold the middle mouse button to pan around.

Any suggestions?

FedeB
2nd February 2010, 17:55
Hi, I have a similar problem.
I'm using the standart rubberband selection but it does not refresh the QGraphicsView. It paints many rectangles and does not erase them.
Any Ideas.
I've attached a snapshot.
4236
Thanks

aladagemre
2nd February 2010, 23:33
Your attachment can't be downloaded. Could you check it please?

I have rubberband problem with PyQt4.6 but not with CPP+Qt4.

And I have also the fitting problem. When I add new items or move the existing items, view can not fit although it's given correct sceneRect coordinates.