QTreeWidgetItem *parent = currentItem->parent();
for (int i = 0; i < currentItem->parent()->childCount(); ++i) { QTreeWidgetItem *sibling = currentItem->parent()->child(i); }This code loops through all the siblings of the current item by accessing them through their parent using 'parent()' and 'child(i)'. Package library: Qt library.