答案 0 :(得分:1)
Houdini 17在这里,此代码可以正常工作。您应该发布代码示例。
from hutil.Qt import QtWidgets
def onCreateInterface():
tree = QtWidgets.QTreeWidget()
tree.setAlternatingRowColors(True)
item1 = QtWidgets.QTreeWidgetItem(tree, ['item1'])
item11 = QtWidgets.QTreeWidgetItem(item1, ['item11'])
item111 = QtWidgets.QTreeWidgetItem(item11, ['item111'])
item1111 = QtWidgets.QTreeWidgetItem(item111, ['item1111'])
item2 = QtWidgets.QTreeWidgetItem(tree, ['item2'])
item21 = QtWidgets.QTreeWidgetItem(item2, ['item21'])
item211 = QtWidgets.QTreeWidgetItem(item21, ['item211'])
item212 = QtWidgets.QTreeWidgetItem(item21, ['item212'])
item213 = QtWidgets.QTreeWidgetItem(item21, ['item213'])
return tree