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. Issue using setDragDropMode( QAbstractItemView::InternalMove ) on a QListWidget
Forum Updated to NodeBB v4.3 + New Features

Issue using setDragDropMode( QAbstractItemView::InternalMove ) on a QListWidget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 376 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.
  • AndyBriceA Offline
    AndyBriceA Offline
    AndyBrice
    wrote on last edited by
    #1

    I call setDragDropMode( QAbstractItemView::InternalMove ) on a QListView, so you can drag the list into a different order. When I detect a drop has happened it waits 2 seconds to see if there are any more drops, if not the changes are committed. It works fine except when the user is half way through a second drag when the 2 seconds from the first drag is up. It all then gets messy.

    Is there any way to detect that an internal move is in progress on the QListView?

    24bc348e-c076-4a88-9249-53aab4f5bdf6-image.png

    1 Reply Last reply
    0
    • AndyBriceA Offline
      AndyBriceA Offline
      AndyBrice
      wrote on last edited by AndyBrice
      #2

      I tried using eventFilter() and mousePressEvent(), mouseReleaseEvent() etc, but I couldn't work out if the mouse had been released outside the QListWidget.

      1 Reply Last reply
      0
      • AndyBriceA Offline
        AndyBriceA Offline
        AndyBrice
        wrote on last edited by
        #3

        In the end I went with checking delaying the update until

        QApplication::mouseButtons() == Qt::NoButton;

        It's a bit inelegant, but it seems to work.

        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