[PyKDE] QListView bugs (...)

Phil Thompson phil at river-bank.demon.co.uk
Mon Jul 1 11:45:00 BST 2002


Thierry Jouve wrote:

> Hi,
> 
> I investigate a little bit more, and I've found that a call to
> triggerUpdate() (on the QListView object) and to processEvents() (on the
> QApplication object) resolve the problem...
> 
> But :
>   - it's not very well to call "triggerUpdate" after each update on a
> QListView
>   - it's strange that only the second call has a problem, whereas the
> third works fine !!!


It works for me whether or not triggerUpdate() is called.


> Concerning QListCiewItem bugs, here is a script that demonstrate the
> problem :
> #!/usr/bin/env python
> 
> from qt import *
> 
> if __name__ == "__main__" :
> 
>    import sys
>    qa = QApplication(sys.argv)
> 
>    lv = QListView()
>    lv.show()
>    lv.addColumn("Items")
> 
>    print "Before inserting"
> 
>    qlvi = QListViewItem(None, "Item1")
> 
>    print "After inserting"
> 
>    lv.insertItem(qlvi)
> 
> 
>    qa.setMainWidget(lv)
>    qa.exec_loop()


Although the Qt docs don't explicitly say it, you must pass a non-NULL 
(or non-None) value as the parent. If you look at the Qt source code you 
see that the parent pointer is always derefenced.

Phil




More information about the PyQt mailing list