比较人性的想法是,每个 Item 带一个唯一的 ID ( int 或 str ),可以自己设置,到时候遍历一遍把所有选中的 Item 的 ID 加入到 List 中,按照需要处理。但是 Qt Designer 里属性什么的好像没有类似的属性可以填,Qt Designer 生成的代码里好像只有 Item 对于 Parent 的 Index,这就不好弄了。。 这个功能好像也挺常用的啊。。
https://img.alicdn.com/imgextra/i3/3024818780/TB2SjWybMZjyKJjy0FhXXcdlFXa_!!3024818780.png