Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsItem scene()->itemAt() - get list of items?
Qt 6.11 is out! See what's new in the release blog

QGraphicsItem scene()->itemAt() - get list of items?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.0k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    I'm dragging an item and while I drag it over another item I'd like to get a debug of what item/items are under my current item mouse position... But when I call scene()->itemAt(event->scenePos(),QTransform()) I get the currently dragged item and no more info. How can I get other items that are under the mouse while I drag?

    Regards
    Dariusz
    TIA

    K 1 Reply Last reply
    0
    • D Dariusz

      Hey

      I'm dragging an item and while I drag it over another item I'd like to get a debug of what item/items are under my current item mouse position... But when I call scene()->itemAt(event->scenePos(),QTransform()) I get the currently dragged item and no more info. How can I get other items that are under the mouse while I drag?

      Regards
      Dariusz
      TIA

      K Offline
      K Offline
      kenchan
      wrote on last edited by
      #2

      @Dariusz
      Take a look at the items(...) functions.
      You might have to implement the shape() function for custom graphic items.

      D 1 Reply Last reply
      1
      • K kenchan

        @Dariusz
        Take a look at the items(...) functions.
        You might have to implement the shape() function for custom graphic items.

        D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        @kenchan I'm having dejavu. I could swear I did use that in past and I already asked for it sigh. Thanks! I think I'll get it solved, its coming back to me slowly!

        thanks!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Dariusz
          wrote on last edited by
          #4

          For curious ones

          scene()->items(event->scenePos(),Qt::ContainsItemShape) / or other flag.

          1 Reply Last reply
          1

          • Login

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