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. QTreeView Extended Selection + Drag and Drop

QTreeView Extended Selection + Drag and Drop

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 734 Views
  • 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.
  • E Offline
    E Offline
    elveatles
    wrote on last edited by
    #1

    Is it possible to keep extended selection for a QTreeView that supports drag and drop?
    If dragDropMode is set to DragDrop, then only one item can be dragged from the QTreeView. Of course I can shift + select then drag, but the requirements of my project is to support both extended selection and drag and drop. So the user would select what they want to drag with extended selection, then click and drag the selected items to start a drag and drop. If the user wants to make a different selection, they would start selecting items that are unselected.

    Thanks in advance.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Just to be sure I understand correctly. You want to:

      • start selection
      • extend selection
      • release mouse button and keyboard
      • move the mouse around
      • come back to tree view
      • start drag and drop with a new click using the current selection
        Is it correct ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        elveatles
        wrote on last edited by
        #3

        @SGaist Yes that's correct. Drag would only be triggered when clicking and dragging selected items. If the items are not selected, then no dragging occurs. The selection would be updated instead.

        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