C++ (Qt)QTreeWidgetItem *target=treeWidget->itemAt(pos);if(target){ treeWidget->clearSelection(); target->setSelected(true);}