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. Loop through stacked QGrapicsItems

Loop through stacked QGrapicsItems

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 756 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.
  • T Offline
    T Offline
    Tectu
    wrote on last edited by
    #1

    Let's assume that I have multiple QGraphicsItems laying on top of each other in a QGraphicsScene. I want to give the user the ability to select which ones he want to move. Which is the correct way to implement this feature?
    I as I also have different QGraphicsItems (like lines and text) on the scene I'd like not to modify the mouseMoveEvent() of each (subclass). Is there a common way to do this within the QGraphicsScene class so it simply routes the mouse events to the correct item?

    Thank you very much for your help.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arsinte_andrei
      wrote on last edited by
      #2

      you have to create an area where the user clicked and to see how many graphics items you have in this area yourself because the click will get only the top graphic item. also you can create a item bar on the side like in gimp (layers) where the user will be able to select a layer (graphic item) even if the item is under other graphic items... depending on the way that you want to approach but from my point of view having like a navigation bar is a lot easy.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tectu
        wrote on last edited by
        #3

        Thank you very much for your suggestion. I think the navigational approach makes indeed a lot more sense.
        I will see where I go from here.

        1 Reply Last reply
        0

        • Login

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