Important: Please read the Qt Code of Conduct -

Detecting what is shown on the display

  • 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 ?

  • Hi,

    QGraphicsItem has isVisible() function ... is that what you need?


    P.S.: Oops, I make a mistake ... that function is not related to "QGraphicsView" visibility .. sorry ...

  • 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.

  • I see ... anyway, that's not reported in the documentation clearly.


Log in to reply