Dear Friends
I am trying to implement drag and drop for QTreeWidgetItem.I have some toplevelitems and some of them have children items. I want to implement hte drag and drop functionality for the toplevel items, when an item if dragged and dropped the toplevele items and its children items all should occupy the new place. Somekind of reordering I want to achieve. Please give me some guidelines.
I am curreny trying to implement startDrag() but its crashing.

void Tree::startDrag(Qt:ropActions supportedActions)
{
QDrag *drag = new QDrag(this);
QMimeData *data = new QMimeData;
data->setText(currentItem()->text(0));
drag->setMimeData(data);
drag->exec(supportedActions, Qt::MoveAction);
}

Thanks in advance