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. Howto draw a selection frame that's visible in only one QGraphicsView?
Forum Updated to NodeBB v4.3 + New Features

Howto draw a selection frame that's visible in only one QGraphicsView?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    I have a GraphicsScene that can potentially be visible in multiple Views. However, the selection should only be visible in the view the user is actually working in.

    How would I create a selection frame that's visible only in one view?
    Side note: Performance is an issue, since hundreds of items can be multi-selected.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      PeerS
      wrote on last edited by
      #2

      Even though I did not try it I would say you can not do it.

      If your selection frame is part of the scene then all attached views showing that part of the scene where the selection frame is have to show it.

      So in order to achieve what you want I guess you have to draw your selection frame outside the scene and then forward its coordinates to the scene so the 'selected' elements can be selected. The drawing of the selection frame could occure on a transparent widget laying in front of your view ...

      Peer

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        I could always customize my paint method. If there was a way to find out which view I am currently painting to...

        1 Reply Last reply
        0
        • P Offline
          P Offline
          PeerS
          wrote on last edited by
          #4

          Btw, have you had a look into QGraphicsView::RubberBandDrag whether it maybe provides what you need?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            I am aware of the rubber band, but I need full drawing capabilities.

            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