PyQt 4.7
I have a QTableView with custom QSortFilterProxyModel and QItemDelegate.
When I set the root index on the table, I'm attempting to loop through all the rows and openPersistentEditor on column 1. The following is crashing the first call of openPersistentEditor. I've tried passing the proxy's sourceModel() index via mapToSource. Any ideas if this is possible or where I'm going wrong?
table_view.setRootIndex(index)
for i in xrange(self.model().rowCount(self.rootIndex())):
index = self.model().createIndex(i,1)
self.openPersistentEditor(index)
table_view.setRootIndex(index)
for i in xrange(self.model().rowCount(self.rootIndex())):
index = self.model().createIndex(i,1)
self.openPersistentEditor(index)
To copy to clipboard, switch view to plain text mode
Many thanks.
Added after 12 minutes:
Solved
i in xrange(self.model().rowCount(self.rootIndex())):
self.openPersistentEditor(self.model().index(i,1,self.rootIndex()))
i in xrange(self.model().rowCount(self.rootIndex())):
self.openPersistentEditor(self.model().index(i,1,self.rootIndex()))
To copy to clipboard, switch view to plain text mode
Bookmarks