Detecting what is shown on the display
-
wrote on 23 Nov 2010, 10:38 last edited by
Hi,
I'm having a problem, which I hope that someone here can help me with.
I have a QGraphicsView and a QGraphicsScene. The QGraphicsScene contains a number of tiles (images), and I'm interested in figuring out which items are not on the screen, i.e is not currently shown. The scene is larger than the display, and hence not everything is shown.
I've tried to use the items method in QGraphicsScene (to figure out what is on the screen and from that derive what it not on the screen) and it does not give me what I want. I assume that the incorrect results are because, the QGraphicsView are translated and rotated.
Giving the transformation of the QGraphicsView to the QGraphicsScene items method, does not solve this issue.
Any one has any ideas ? .. Some simple way to detect what is currently on the display/screen or what is not ?
-
wrote on 23 Nov 2010, 10:42 last edited by
Hi,
QGraphicsItem has isVisible() function ... is that what you need?
T.
P.S.: Oops, I make a mistake ... that function is not related to "QGraphicsView" visibility .. sorry ...
-
wrote on 23 Nov 2010, 11:27 last edited by
I think i found a solution. If I use the items method of QGraphicsView, it seems to work. I was using it from QGraphicsScene, and that for some reason didn't work.
-
wrote on 23 Nov 2010, 11:43 last edited by
I see ... anyway, that's not reported in the documentation clearly.
T.
1/4