[PyKDE] QListView bugs

Thierry Jouve jouve at esrf.fr
Mon Jul 1 11:06:00 BST 2002


Hi,

I have a curious bug with QListView...

When I run :

#!/usr/bin/env python

from qt import *

if __name__ == "__main__" :

   import sys
   qa = QApplication(sys.argv)

   lv = QListView()
   lv.addColumn("Items")

   qlvi1 = QListViewItem(lv, "Item1")
   qlvi2 = QListViewItem(lv, "Item2")
   qlvi3 = QListViewItem(lv, "Item3")

   lv.insertItem(qlvi1)
   lv.insertItem(qlvi2)
   lv.insertItem(qlvi3)

   lv.update()
   lv.triggerUpdate()

   print lv.findItem("Item1", 0, Qt.ExactMatch)
   print lv.findItem("Item2", 0, Qt.ExactMatch)
   print lv.findItem("Item3", 0, Qt.ExactMatch)

   lv.show()

   qa.setMainWidget(lv)
   qa.exec_loop()


The second "findItem" call returns None... and it is always the second
"findItem" call that returns None, even if items are created or inserted
in different order... or if params of findItem are different...

Another (little) problem :
   When you create a QListViewItem with None as parent, you get a
marvelous segfault

Python : 2.1.1, Qt : 3.0.2, PyQt : 3.2.4
Linux Suse 72, kernel : 2.4.4


--
   Thierry JOUVE

   BLISS GROUP - ESRF
   Mail : jouve at esrf.fr, Office : 155b, Tel : 29-46




More information about the PyQt mailing list