Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Strictly Inside Rubberband Select?

    General and Desktop
    2
    2
    596
    Loading More Posts
    • 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
      pkqt last edited by

      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 Reply Quote 0
      • A
        alex_malyu last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post