Results 1 to 2 of 2

Thread: get currently visible items in QGraphicsScene

  1. #1
    Join Date
    Oct 2015
    Posts
    17
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default get currently visible items in QGraphicsScene

    hi friends.

    i want to get currently visible (showing) item(s) in QGraphicsScene and if number of items is more than one determine which one's showing part is more than others.

    sorry for my bad english

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,546
    Thanks
    13
    Thanked 1,578 Times in 1,507 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: get currently visible items in QGraphicsScene

    You can ask the view which items fall inside its viewport rectangle:
    Qt Code:
    1. QList<QGraphicsItem *> items = view->items(view->viewport->rect());
    To copy to clipboard, switch view to plain text mode 

    I am not familiar enough with the API to answer the amount of intersection aspect of this question.

  3. The following user says thank you to ChrisW67 for this useful post:

    Santa.fat (29th October 2015)

Similar Threads

  1. Replies: 4
    Last Post: 27th October 2015, 12:42
  2. Replies: 1
    Last Post: 22nd February 2010, 10:53
  3. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:13
  4. Replies: 3
    Last Post: 10th April 2006, 19:04
  5. How do I find out which widgets/canvas items are visible?
    By Tommytrojan in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 13:22

Tags for this Thread

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.