convert QTreeWidget.setFirstItemColumnSpanned

convert QTreeWidget.setFirstItemColumnSpanned(item, True) to
item.setFirstColumnSpanned(True)

the former is deprecated since Qt 5.15.2 and removed in Qt 6.
This commit is contained in:
KIU Shueng Chuan 2021-01-10 11:49:06 +08:00
parent 4abbc2d5cd
commit 119c5fa3d0
2 changed files with 6 additions and 6 deletions

View File

@ -429,11 +429,11 @@ class GroupParameterItem(ParameterItem):
tw = self.treeWidget()
if tw is None:
return
tw.setFirstItemColumnSpanned(self, True)
self.setFirstColumnSpanned(True)
if self.addItem is not None:
tw.setItemWidget(self.addItem, 0, self.addWidgetBox)
tw.setFirstItemColumnSpanned(self.addItem, True)
self.addItem.setFirstColumnSpanned(True)
def addChild(self, child): ## make sure added childs are actually inserted before add btn
if self.addItem is not None:
ParameterItem.insertChild(self, self.childCount()-1, child)
@ -609,7 +609,7 @@ class ActionParameterItem(ParameterItem):
if tree is None:
return
tree.setFirstItemColumnSpanned(self, True)
self.setFirstColumnSpanned(True)
tree.setItemWidget(self, 0, self.layoutWidget)
def titleChanged(self):
@ -646,7 +646,7 @@ class TextParameterItem(WidgetParameterItem):
if tw is None:
return
tw.setFirstItemColumnSpanned(self.subItem, True)
self.subItem.setFirstColumnSpanned(True)
tw.setItemWidget(self.subItem, 0, self.textBox)
# for now, these are copied from ParameterItem.treeWidgetChanged

View File

@ -65,7 +65,7 @@ class DataTreeWidget(QtGui.QTreeWidget):
subnode = QtGui.QTreeWidgetItem(["", "", ""])
node.addChild(subnode)
self.setItemWidget(subnode, 0, widget)
self.setFirstItemColumnSpanned(subnode, True)
subnode.setFirstColumnSpanned(True)
# recurse to children
for key, data in childs.items():