用QTreeWidget不行吗?我看了QTreeWidget的文档:
void QTreeWidget::setItemWidget ( QTreeWidgetItem * item, int column, QWidget * widget )
Sets the given widget to be displayed in the cell specified by the given item and column.
The given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the tree widget item.
This function should only be used to display static content in the place of a tree widget item. If you want to display custom dynamic content or implement a custom editor widget, use QTreeView and subclass QItemDelegate instead.
This function cannot be called before the item hierarchy has been set up, i.e., the QTreeWidgetItem that will hold widget must have been added to the view before widget is set.
Note: The tree takes ownership of the widget.
This function was introduced in Qt 4.1.
See also itemWidget() and Delegate Classes.
他说,这样设置的只是静态的内容,如果要动态编辑就用QTreeView,留下个QQ详聊吧哥们,我的 983970335