[PyQt] Re: Setting backgroud color to a QListViewItem

Christoph Burgmer chrislb at gmx.de
Mon Apr 14 20:38:00 BST 2008


> Someone can send example code to set background color to a
> QListViewItem (pyqt3)?

defaultPalette = QtGui.QPalette(element)
newPalette = QtGui.QPalette(defaultPalette)
newPalette.setColor(QtGui.QPalette.Base, Qt.green)
element.setPalette(newPalette)

This at least works for QLineEdit under KDE4.

Christoph


More information about the PyQt mailing list