[PyKDE] QTable and background color.
tuxgame at email.it
Mon Oct 6 15:27:01 BST 2003
I am trying to implement a QTable where n cells on every row are painted on a
Searching on the ML, I find that I must reimplement the paint method. Fine.
Now I have only one problem: the setting of the color is located in a for
cicle (I don't know in advance what cell I must modify), but I only get a red
background on the last cell I change.
This is the code i use:
for x in range(0,cols):
self.tabella.setItem(barca, x, self.item)
(the for over the rows are external to this one)
and this is the implementation of the paint method:
def __init__(self, table, edittype, text):
def paint(self, painter, colorgroup, rect, selected):
cg = QColorGroup(colorgroup)
QTableItem.paint(self,painter, cg, rect, selected)
It works, but only for the last cell I update
I need to change 2 cell on every row.
All the cells I need to change lose the text, except for the last one, who
mantain the correct text and have a red background.
Any hints ?
We are the opensource. Existence as you know it is over. We will add
your proprietary features and technological distinctiveness to own
opensource project. Resistence is futile. Windows is closed.
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Fare shopping con EmailConto Risparmio è facile e conveniente: con un solo click sconti tutti i tuoi acquisti!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=839&d=6-10
More information about the PyQt