I want new items to be inserted after the last row instead of first row. Plz help!
@QTreeWidgetItem *item1=new QTreeWidgetItem(ui->treeWidget);
item1->setText(0,hostname);@
Yes, because YOU put the item into the first (index at 0)position.
Try something like this:
item1->setText(Your_QTreeWidget::topLevelItemCount(),hostname);