This example illustrates how to select the items in WinUI TreeView (SfTreeView)? WinUI TreeView (SfTreeView) allows selecting the items either programmatically or mouse click/touch interactions by ...
PySide2 (Qt for Python) で複数アイテムを表示する際には、List / Tree / Table のそれぞれに対して Widget 系と View 系の二種類のクラスが用意されていますが、ごく簡単なプログラムでない限り、Model / View に基づいた QListView / QTreeView / QTableView を使うのが良いようです。