Results 1 to 3 of 3

Thread: How to recognize if QGraphicsItem is currently showed in QGraphicsView

  1. #1
    Join Date
    Dec 2008
    Location
    Czech
    Posts
    44
    Thanks
    2
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default How to recognize if QGraphicsItem is currently showed in QGraphicsView

    Hi,
    I have a lot of items in scene.
    Is there possibilities, what item are currently visible, when changing the sceneRect?
    Does QGraphicsItem has such a property?

    Radek
    Last edited by radek.z; 12th February 2009 at 09:58.

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to recognize if QGraphicsItem is currently visible by QGraphicsView

    From QT Assistant


    bool QGraphicsItem::isVisible () const
    Returns true if the item is visible; otherwise, false is returned.
    Note that the item's general visibility is unrelated to whether or not it is actually being visualized by a QGraphicsView.

  3. #3
    Join Date
    Dec 2008
    Location
    Czech
    Posts
    44
    Thanks
    2
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to recognize if QGraphicsItem is currently visible by QGraphicsView

    Note that the item's general visibility is unrelated to whether or not it is actually being visualized by a QGraphicsView.
    Yeah, thats what I mean. I need to know, what item are currently in visible part of scene. If there is some properties? So far I do it through list of items in current sceneRect, but this is not the best way.
    Radek

Similar Threads

  1. QGraphicsView, QGraphicsItem, QGraphicsScene
    By Shuchi Agrawal in forum Newbie
    Replies: 10
    Last Post: 23rd March 2011, 20:50
  2. Replies: 3
    Last Post: 21st October 2008, 11:41
  3. (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem
    By antonio.r.tome in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 10:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.