[PyKDE] QListViewItems

Peter Osborne pete at bookware3000.ca
Sat Sep 21 00:57:01 BST 2002


Hello All,

I was wondering if someone could enlighten me on why Qt is doing this.

I have reimplemented QListViewItem to allow me to change font colors and also 
to allow me to have Cell 1 of my ListView overwrite Cell 2 when needed. 
Here's my paintCell method.
________________________________________________________________
def paintCell(self,qpainter,cg,col,width,align):
        qpainter.setFont(self.font)
        if self.overwrite_columns:
                if col == 1:
                        width += 90
                elif col == 2:
                        return
        
QListViewItem.paintCell(self,qpainter,self.pal.active(),col,width,align)
________________________________________________________________

If overwrite_columns is true, it tells column one that it is 90 pixels wider 
and ignores column 2.

The problem is, when I add an item to my QListView, it truncates the last 90 
pixels but if I select a record or scroll, it renders properly.

Does anyone know if QListView or QListViewItem does some behind the scenes 
erasing cells?

Thanks,
-Pete




More information about the PyQt mailing list