Results 1 to 3 of 3

Thread: QTreeView find out when the drag operation ends

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default QTreeView find out when the drag operation ends

    Hi everybody out there! Is there any way to know when dragging some item of the tree view is finished? I see only QAbstractItemView::dropEvent, but I have to consider it can be canceled also. I need this to implement my own drop indicator, so I should know when to show it.

  2. #2
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: QTreeView find out when the drag operation ends

    I guess drag-n-drop operation ends with one of the following events: QEvent::Drop and QEvent::DragLeave.
    Did you check QEvent::DragLeave?

  3. The following user says thank you to llev for this useful post:

    mentalmushroom (4th October 2011)

  4. #3
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QTreeView find out when the drag operation ends

    Thanks, it seems it is what I was searching for. I know this method, but qt docs tells "This function is called when the item being dragged leaves the view", so I thought it won't be called when a user presses escape or drops the item, but it actually does.

Similar Threads

  1. Replies: 4
    Last Post: 30th September 2011, 14:00
  2. QTreeView Drag and Drop
    By theprobe in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2011, 22:08
  3. Replies: 0
    Last Post: 4th May 2010, 10:24
  4. QTreeView: Drag and Drop
    By laugusti in forum Newbie
    Replies: 7
    Last Post: 19th March 2010, 19:05
  5. Drag & drop for QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2006, 14:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.