Results 1 to 5 of 5

Thread: Drag and Drop item inside QTreeWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Question Drag and Drop item inside QTreeWidget

    Dear,

    I'm new with Qt, it's one day that I'm trying to solve this problem...
    I want to be able to drag and drop elements inside my QTreeWidget but I want that the hierarchy is respected... here an example:

    Qt Code:
    1. tree->setAcceptDrops(true);
    2. tree->setDragEnabled(true);
    3. tree->setDragDropMode(QAbstractItemView::InternalMove);
    4.  
    5. QTreeWidgetItem* dad = new QTreeWidgetItem(tree,0);
    6.  
    7. QTreeWidgetItem* child = new QTreeWidgetItem(dad,0);
    To copy to clipboard, switch view to plain text mode 
    I want to be able to drag and drop only "dad" elements (with its childs attahced obviously) at the same level as the other "dad" elements...
    I hope you can understand my problem... if not please let me know and I'll try to explain it better!
    Thank you very much

    Lisa
    Last edited by jpn; 5th July 2008 at 18:13. Reason: missing [code] tags

Similar Threads

  1. QTreeWidget Drag and drop
    By zell99 in forum Newbie
    Replies: 15
    Last Post: 7th August 2010, 13:28
  2. Drag and Drop in a QTreeWidget subclass
    By kishore in forum Qt Programming
    Replies: 2
    Last Post: 14th May 2008, 07:12
  3. Drag an item from QTreeWidget and drop in TableView
    By steg90 in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2007, 11:42
  4. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41
  5. drag and drop with item views
    By castorvert in forum Qt Programming
    Replies: 14
    Last Post: 27th March 2006, 10:12

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.