Scrolling QGraphicsView and QGraphicsScene
Hi,
I have QGraphicsScene instance set to QGraphicsView on the GUI with scrollbars enabled and full view port update. But when I scroll my graphics view I get the items added to qgraphics scene disappeared on some point,
though they are added in code correctly and are expected to be displayed upon scroll ( custom class inherited from QGraphicsItem ):
One can see how they disappear on application run on this video screen cast:
https://www.box.com/s/h4h94×1avgay1crzvyzx
Can somebody hint what is the problem, how to resolve so the graphics items will not disappear on the view?
Thanks in advance.
Re: Scrolling QGraphicsView and QGraphicsScene
As the link does not work, and with not much information I can only guess that you might have some problem with bounding rectangle
Re: Scrolling QGraphicsView and QGraphicsScene
Why do you not derive your object from QGraphicsObject? It is essentially the same as you are doing manually now, and does it correctly.
But as Santosh says, without code we have no clue what you might be doing wrong.
Re: Scrolling QGraphicsView and QGraphicsScene
sorry for that incorrect link:
try this link for the video:
https://www.box.com/s/h4h94x1avgay1crzvyzx
Re: Scrolling QGraphicsView and QGraphicsScene
My player does not support .ogv files yet :(
So show us how do you implement CSquare class?
Re: Scrolling QGraphicsView and QGraphicsScene
Thank you. Santosh is absolutely right - the problem was in custom function in the inherited class:
That should return valid rectangle. Now I fixed that in my project and m going to remove the video.
Thank you very much.
http://realvirtualdevelopment.co.nr.