Results 1 to 6 of 6

Thread: QTreeView - drop indicator not showing for an external drag from another tree view

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTreeView - drop indicator not showing for an external drag from another tree view

    I have the drag and drop indicators working fine for internal moves within the same tree view (say TreeView1).

    But, the indicators are not visible when dragging from an external tree view (TreeView2 -> TreeView1).

    Any idea what is needed to show the drop indicators when dragging from an external tree view?

    Here's my code for the tree view that is the drop target.

    Qt Code:
    1. void MyTreeView::dragMoveEvent(QDragMoveEvent *event)
    2. {
    3. // Call base class -- this shows the drop indicators
    4. QTreeView::dragMoveEvent(event);
    5.  
    6. if (event->mimeData()->hasFormat("text/plain") )
    7. {
    8. event->acceptProposedAction();
    9. event->accept();
    10. }
    11. else
    12. {
    13. event->ignore();
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by alketi; 3rd March 2015 at 22:17.

Similar Threads

  1. Drag and drop from list/tree widget to graphics view
    By chaltier in forum Qt Programming
    Replies: 1
    Last Post: 25th March 2012, 04:15
  2. Drag and Drop indicator Position
    By whitefurrows in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2011, 11:35
  3. Replies: 2
    Last Post: 13th October 2010, 21:51
  4. Replies: 0
    Last Post: 4th May 2010, 10:24
  5. Drag and drop indicator
    By iswm in forum Qt Programming
    Replies: 2
    Last Post: 19th April 2007, 18:58

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.