Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Detecting what is shown on the display

    Game Development
    2
    4
    3024
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sandberg 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 ?

      1 Reply Last reply Reply Quote 0
      • T
        tony 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 ...

        1 Reply Last reply Reply Quote 0
        • S
          Sandberg 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.

          1 Reply Last reply Reply Quote 0
          • T
            tony last edited by

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

            T.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post