Results 1 to 1 of 1

Thread: [SOVLED] Re: openPersistentEditor for column of a view with proxy

  1. #1
    Join Date
    Jun 2012
    Posts
    25
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X

    Default [SOVLED] Re: openPersistentEditor for column of a view with proxy

    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?

    Qt Code:
    1. table_view.setRootIndex(index)
    2. for i in xrange(self.model().rowCount(self.rootIndex())):
    3. index = self.model().createIndex(i,1)
    4. self.openPersistentEditor(index)
    To copy to clipboard, switch view to plain text mode 

    Many thanks.


    Added after 12 minutes:


    Solved

    Qt Code:
    1. i in xrange(self.model().rowCount(self.rootIndex())):
    2. self.openPersistentEditor(self.model().index(i,1,self.rootIndex()))
    To copy to clipboard, switch view to plain text mode 
    Last edited by BreakBad; 26th June 2012 at 18:08.

Similar Threads

  1. I can't add item in a proxy view
    By Nate River in forum Qt Programming
    Replies: 0
    Last Post: 27th December 2011, 22:56
  2. Replies: 2
    Last Post: 9th December 2010, 17:22
  3. Proxy model / view update problem
    By pascal123 in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2010, 01:02
  4. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  5. Filter Proxy Model to Autoupdate View
    By Big Duck in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2006, 20:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.