title: QTreeWidget reordering child items by dragging
body: <p>I have a QTreeWidget which displays a single root node and one level of child nodes only.
  I need to permit the re-ordering of the child nodes.
  They must never be re-parented.</p>
  
  <p>This is how I enable the dragging of items in the QTreeWidget :</p>
  
  <pre><code>ui-&gt;levelElements-&gt;setSelectionMode(QAbstractItemView::SingleSelection);
  ui-&gt;levelElements-&gt;setDragEnabled(true);
  ui-&gt;levelElements-&gt;viewport()-&gt;setAcceptDrops(true);
  ui-&gt;levelElements-&gt;setDropIndicatorShown(true);
  ui-&gt;levelElements-&gt;setDragDropMode(QAbstractItemView::InternalMove);
  </code></pre>
  
  <p>The root item is inserted like this :</p>
  
  <pre><code>pItem = new QTreeWidgetItem(ui-&gt;levelElements);
  pItem-&gt;setText(0, node.firstChild().nodeValue());
  pItem-&gt;setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled);
  </code></pre>
  
  <p>When I insert a child into the view, it is declared like this :</p>
  
  <pre><code>pItem = new QTreeWidgetItem();
  pItem-&gt;setText(0, strFileName);
  pItem-&gt;setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled);
  pTreeRoot-&gt;addChild(pItem);
  </code></pre>
  
  <p>At this point, I am able to drag a child item and "re-insert" it in the list of child items.  I can also move it to the root level - which I do not want.</p>
  
  <p>I am using QT Creator v3 and so the QTreeWidget is within my UI definition file.</p>
  
  <p>Have I missed something here ?</p>