title: QTreeWidget drag and drop for reordering selects wrong item
body: <p>After having followed the recommendations given here : <a href="https://stackoverflow.com/questions/21283934/qtreewidget-reordering-child-items-by-dragging">QTreeWidget reordering child items by dragging</a>, the dragged item is not selected.</p>
  
  <p>So, quite naturally, I tried to get the dragged item and then call setSelected() on it.</p>
  
  <p>The result is that the item before the correct on is selected.</p>
  
  <p>I subclass QTreeWidget to override dropEvent like this -</p>
  
  <pre><code>QTreeWidgetItem *pItem;
  QModelIndex dropIndex = indexAt(pEvent-&gt;pos());
  
  if(dropIndex.isValid() == false)
  {
      pEvent-&gt;setDropAction(Qt::IgnoreAction);
      pEvent-&gt;accept();
      return;
  }
  
  pItem = this-&gt;itemAt(pEvent-&gt;pos());
  QTreeWidget::dropEvent(pEvent);
  </code></pre>
  
  <p>How can I get the pointer to the correct QTreeWidgetItem which has been dropped ?</p>