3条回答 默认 最新
- bostonAlen 2022-10-18 17:22关注
以button为例,
def add_widget(self, button, widget): """creates a QWidgetItem containing the widget, as child of the button-QWidgetItem """ section = QTreeWidgetItem(button) section.setDisabled(True) self.tree.setItemWidget(section, 0, widget) return section
从原函数上看,继承于widget的组件应该都可以。
void setItemWidget(QTreeWidgetItem *item, int column, QWidget *widget);
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报