Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
About PySide Qt UI design: define delegates as tree items
picard47at last edited by
Hello! I am doing a plug-in for maya. The tool I use is Qt PySide. I have trouble dealing with a custom treeview design.
What i want to achieve is making a tree like structure, each item consist of a root and some child nodes(in the same layer). Each children consist of several elements such as combobox and push button, while the root only for showing text. Each tree item represent the information and the options of a render layer, the user can adds new tree item or remove an existed one.
The concept is similar to these images:
The problem is I am not quite sure what is the proper way to combines different qt elements into a single child node.
I hope there is a way to set tree node as a “table” like item, each item consists of different qt control elements. It’s similar to the idea below, while the cells of each column is qt controller instead of pure text.
Currently I define different delegates for each qt controllers (button, combobox… .etc.) . In order to set each cell as different element I use setItemDelegateForRow() and setItemDelegateForColumn(). However i haven’t find a correct way to make the tree index right.