[Qt-interest] QTreeWidget - problems with drag & drop

Esdras Beleza listas at esdrasbeleza.com
Wed Jun 16 22:19:23 CEST 2010


Hi,


I have a class that inherits from QTreeWidget and have the following code in
its constructor:

    setAcceptDrops(true);
    setDragEnabled(true);
    setDropIndicatorShown(true);
    setDragDropMode(QAbstractItemView::InternalMove);


Two questions:

The code above allows it to get drag and drop working the way I like, but
when I drop a item A above another item B, it puts the item A as a child of
B.

How can I avoid A from becoming child of B? I'd like to have only top-level
items on my list. Will I must to override all those d'n'd methods to get
that?






Esdras

--
http://www.esdrasbeleza.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100616/4d5218e5/attachment.html 


More information about the Qt-interest-old mailing list