Results 1 to 2 of 2

Thread: drag and drop from QTreeView

  1. #1
    Join Date
    Jan 2006
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default drag and drop from QTreeView

    I have a QTreeView initialized with

    setDragEnabled(true);
    setAcceptDrops(true);
    setDropIndicatorShown(true);

    then I use the startDrag, dragMoveEvent and dropEvent to handle the Items.

    This works fine with Qt 4.0.1 but doesn't work anymore with the newer Qt versions:
    startDrag is called but never dragMoveEvent.

    I read in the forums that other people have the same problem, but they couldn't be helped.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: drag and drop from QTreeView

    Quote Originally Posted by Untersander
    then I use the startDrag, dragMoveEvent and dropEvent to handle the Items.
    You shouldn't need (and shouldn't use) any of those with QTreeView. You should use the model-view based approach for model-aware widgets.

Similar Threads

  1. Preserving structure in QTreeView drag and drop
    By Tito Serenti in forum Qt Programming
    Replies: 1
    Last Post: 14th February 2009, 04:39
  2. Drag and drop in QTreeView
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 27th July 2008, 10:36
  3. Drag and Drop on Whitespace of QTreeView
    By T1c4L in forum Qt Programming
    Replies: 6
    Last Post: 14th May 2008, 14:29
  4. Drag & drop items on the same QTreeView
    By wind in forum Qt Programming
    Replies: 2
    Last Post: 11th October 2006, 15:29
  5. Drag & drop for QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2006, 15:32

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.