The Doc says the tree takes ownership of the widget, not the item.
So did you try taking the widget before moving the item? Something like:
Qt Code:
  1. QWidget* widget = tree->itemWidget(index, 0);
  2. tree->insertTopLevelItem( newindex, tree->takeTopLevelItem( index ) );
  3. tree->setItemWidget(newindex, 0, widget);
To copy to clipboard, switch view to plain text mode