[PyKDE] QListBoxItem

2002-11-04 Thread Rune Hansen

I'm pondering over how to set the text of a single QListBoxItem (not
every item) to bold or to a colour. Can anyone help me?

python2.2.1, pyqt.3.3x

regards

/rune


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] QListBoxItem

2002-11-04 Thread Peter Osborne
Yup,

I've done this.

You need to reimplement the class, redifining the paintCell method. Something 
like this will atleast get you started:

class myListViewItem(QListViewItem):

def __init__(self, qlistview, parent=None):
QListViewItem.__init__(self, qlistview, None)

def setFont(self,family="Arial",size=12,bold=0):
self.font = QFont(family, size)
self.font.setBold(bold)

def paintCell(self,qpainter,cg,col,width,align):
qpainter.setFont()

QListViewItem.paintCell(self,qpainter,self.pal.active(),col,width,align)

-Pete

On November 4, 2002 10:29 am, Rune Hansen wrote:
> I'm pondering over how to set the text of a single QListBoxItem (not
> every item) to bold or to a colour. Can anyone help me?
>
> python2.2.1, pyqt.3.3x
>
> regards
>
> /rune
>
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde