What about adding them as a list, then sorting using http://qt-project.org/doc/qt-4.8/qtreewidgetitem.html#sortChildren ?