Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Detecting what is shown on the display
Forum Update on Monday, May 27th 2025

Detecting what is shown on the display

Scheduled Pinned Locked Moved Game Development
4 Posts 2 Posters 3.5k Views
  • 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 Offline
    S Offline
    Sandberg
    wrote on 23 Nov 2010, 10:38 last edited by
    #1

    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
    0
    • T Offline
      T Offline
      tony
      wrote on 23 Nov 2010, 10:42 last edited by
      #2

      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
      0
      • S Offline
        S Offline
        Sandberg
        wrote on 23 Nov 2010, 11:27 last edited by
        #3

        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
        0
        • T Offline
          T Offline
          tony
          wrote on 23 Nov 2010, 11:43 last edited by
          #4

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

          T.

          1 Reply Last reply
          0

          1/4

          23 Nov 2010, 10:38

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved