How to list items as groups in QListWidget
问题 Is it possible to to set QListWidget items in groups. For example if i am adding the content of a folder to listwidget. i want to show all folders in folders group and files in files group. Like in the image below. Is it possible. 回答1: Create for each group a list with all items, sort the list by an arbitrary property and add the item groups in desired order to listwidget. Between or in front of the groups a delimiter or title can be added, the groups can get different styles. e.g. your files