Results 1 to 2 of 2

Thread: drag and drop problems

  1. #1
    Join Date
    Nov 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default drag and drop problems

    Hey ho

    I am trying to add dragging to a QTreeView containg a QDirModel model but I cannot seem to get entries in the tree to register as draggable. I have read the assistant information and searched the tintinterweb, but the only stuff I can find is a little obscure. I have tried the ideas in the QT examples but I am getting nowhere fast. So, does anyone have an idiots guide to drag and drop in QT?

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: drag and drop problems

    See QAbstractItemView::setDragEnabled();
    The model (or its items) has to support dragging as well (by implmenting mimeData() and returning the apropriate QAbstractItemModel::flags(). I guess QDirModel does that already.

    HTH

Similar Threads

  1. Drag & drop with model/view (Qt4)
    By yogeshm02 in forum Qt Programming
    Replies: 16
    Last Post: 19th September 2011, 20:36
  2. Drag & Drop when parent and childs accept drops?
    By gri in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2008, 09:00
  3. Problem with a cursor during Drag and Drop
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2007, 15:46
  4. Replies: 7
    Last Post: 8th September 2006, 16:19
  5. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41

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.