0

I have some Python command line tools ready. So now I am trying to create a GUI so that with one click, I can execute the tool. I am trying out Pyside and creating a QTreewidget at the moment. I am inputting the items one by one on QT designer. However, when i use pyside-uic to convert it into a .py file, the Qtree items are numbered item1, item2 etc. for example,

 self.treeWidget_1.setObjectName("treeWidget_1")
 item_0 = QtGui.QTreeWidgetItem(self.treeWidget_1)
 item_1 = QtGui.QTreeWidgetItem(item_0)
 item_2 = QtGui.QTreeWidgetItem(item_1)

And i couldn't find anywhere to edit the properties (by giving each item a tag/name to identify it with) from the QT designer. Can anyone help. thanks

unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677
dorothy
  • 1,213
  • 5
  • 20
  • 35

2 Answers2

1

It's not possible to do this in Designer. You will need to add the items in your code.

Sebastian Elsner
  • 297
  • 1
  • 6
  • 14
1

You don't need item_i. If you want to do something with your object, you have to inherit in a class the class generated by pysyde-ui(pyuic4). Next you can use self.treewidget_1 in your class with for example self.treewidget_1.topLevelItem(i)

Katsu
  • 1,868
  • 4
  • 19
  • 28