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. Strictly Inside Rubberband Select?
Forum Updated to NodeBB v4.3 + New Features

Strictly Inside Rubberband Select?

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

    Hello,

    In QGraphicsView/QGraphicsScene, the default rubber-band drag selection will select any QGraphicsItems that touches the selection rectangle. However, I would like to change it so that it only select QGraphicsItems whose bounding rectangle lies completely inside the selection rectangle.

    It seems like it'll be an overkill to over-ride all mouse related events just to add this tweak, however, I can't find any straight forward solution from the documentations. What is the simplest way to change the selection behavior?

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

      look for QGraphicsView::setRubberBandSelectionMode ( Qt::ItemSelectionMode mode )

      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