[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] [QListView] endless data() calls
From:       <c.buhtz () posteo ! jp>
Date:       2015-12-24 11:45:26
Message-ID: 3pR8jz33Wkz5vNn () dovecot03 ! posteo ! de
[Download RAW message or body]

I am using QListView and a QListModel with it. There is a list of
strings in it.

For debuging I do print out the row/column on each data() call. And I
can see there that the calls start again when the end is reached.
Again and again...
And nothing is displayed in the view itself.


     def data(self, idx, role):
         if idx.isValid():
             if role == Qt.DisplayRole:
                 print('data row: {} column: {}'
		       .format(idx.row(), idx.column()),
		       end='\r')
                 return self.model[idx.row()]
         return QVariant()

Any ideas what could cause someting like that?

I tweaked a little bit around. It doesn't depend on the length of the
list I think. A 40000 and 1000 list doesn't work. A 4000 list works.
-- 
GnuPGP-Key ID 0751A8EC
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic