I want the new items to be inserted after the last row instead of first row.
for(i=0;i<10;i++)
{
QTreeWidgetItem* tempItem = new QTreeWidgetItem();
tempItem->setText(0,QString::number(i));
ui->treeWidget->insertTopLevelItem(tempItem,i);
}
It inserts the items at top, not at the bottom.
Try this way:
If you want to add a top level item with children:
Or if you want to add more top-levels:
Note, that they are in the order, they got added!