Skip to content

Instantly share code, notes, and snippets.

@fmorency
Created July 17, 2012 20:54
Show Gist options
  • Save fmorency/3132006 to your computer and use it in GitHub Desktop.
Save fmorency/3132006 to your computer and use it in GitHub Desktop.
PySide bug?
#Traceback (most recent call last):
# File "example.py", line 57, in <module>
# root.appendRow(list(p))
#TypeError: 'PySide.QtGui.QStandardItem.appendRow' called with wrong argument types:
# PySide.QtGui.QStandardItem.appendRow(list)
#Supported signatures:
# PySide.QtGui.QStandardItem.appendRow(PySide.QtGui.QStandardItem)
# PySide.QtGui.QStandardItem.appendRow(list)
if __name__ == '__main__':
app = QApplication(sys.argv)
properties = ['Intensity', 'Brightness', 'Name']
params = [10, 70.1, 'Charles']
pairs = zip(properties, params)
model = QStandardItemModel(4,2)
view = QTreeView()
view.setModel(model)
root = model.invisibleRootItem()
for p in pairs:
root.appendRow(list(p))
view.show()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment