Reputation: 61
I have QTreeWidget like this
What should i do to get value from selected row and filename column ?
I have current selected item
item = self.ui.files_treewidget.currentItem()
but how to access to specific cell?
Upvotes: 2
Views: 5557
Reputation: 9104
You can use QTreeWidgetItem.text(column)
, where column is an integer.
In your example you would do:
item = self.ui.files_treewidget.currentItem()
filename = item.text(0)
size = item.text(1)
Upvotes: 4