Skip to content

Instantly share code, notes, and snippets.

@yasarix
Created October 28, 2012 09:22
Show Gist options
  • Save yasarix/3968149 to your computer and use it in GitHub Desktop.
Save yasarix/3968149 to your computer and use it in GitHub Desktop.
Creating groups in ListTree widges in PyQt
parent_item = my_model.invisibleRootItem()
root_item = QtGui.QStandardItem(QtCore.QString("Group 1"))
parent_item.appendRow(root_item)
parent_item = root_item
parent_item.appendRow(
[
QtGui.QStandardItem(QtCore.QString("Data 1"))),
QtGui.QStandardItem(QtCore.QString("Data 2"))),
QtGui.QStandardItem(QtCore.QString("Data 3")))
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment