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

2 Answers 2

1

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

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.