View Full Version : [SOVLED] Re: openPersistentEditor for column of a view with proxy

26th June 2012, 19:08
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?

for i in xrange(self.model().rowCount(self.rootIndex())):
index = self.model().createIndex(i,1)

Many thanks.

Added after 12 minutes:


i in xrange(self.model().rowCount(self.rootIndex())):
self.openPersistentEditor(self.model().index(i,1,s elf.rootIndex()))