Hi there, I'm doing things like this:
Qt Code:
  1. QTreeWidgetItem *newItem = new QTreeWidgetItem("Foo");
  2. theTree->addTopLevelItem(newItem);
  3.  
  4. newItem = new QTreeWidgetItem("Bar");
  5. theTree->addTopLevelItem(newItem);
  6.  
  7. // etc. etc....
  8.  
  9. // after all items have been added, we then call the following within the same function:
  10. theTree->sortItems(0, Qt::AscendingOrder);
To copy to clipboard, switch view to plain text mode 

Of course things are a little more complicated than that, with multiple columns etc. But this is how things are added, sorted, and in the order that it happens. I wouldn't think it could be any simpler than this!

Running Qt 4.6.2 if that makes any difference.