[PyQt] Selected text color of QTreeWidgetItem

Kerri Reno kreno at yumaed.org
Fri Oct 1 22:01:04 BST 2010


I found the following in the archive, and I have the same question.  I
have certain items in my TreeWidget where I set the foreground color
to be red or blue, and that looks fine.  But when the line is
selected, the text turns to white.  I'd like to be able to change the
palette for the QTreeWidgetItem so that the highlighted text remains
the same color.

Thanks in Advance!
Kerri

____________________________________________________
Jake Richards
Tue, 08 Jul 2008 14:41:30 -0700

Hello:
  Is there any way to set the highlighted text color of QTreeWidgetItems?
Using setColor or setForeground, it only sets the color of the
non-highlighted text.  QTreeWidgetItems don't seem to have a setPalette call
but the QTreeWidget does.  The problem with setting the palette on the
QTreeWidget is that it sets the highlighted text color for all items in the
tree.  I'd like to do it on an individual item basis.  Is this possible?
Thanks!

_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

--
If you have an emergency, and can't reach me, please call Craig at
928-257-4980 or the help desk at 928-502-4202.
.·:*¨¨*:·.   .·:*¨¨*:·.   .·:*¨¨*:·.
Yuma Educational Computer Consortium
Compass Development Team
Kerri Reno
kreno at yumaed.org      (928) 502-4240
.·:*¨¨*:·.   .·:*¨¨*:·.   .·:*¨¨*:·.
I'm so busy I don't know if I found a rope or lost a horse!


More information about the PyQt mailing list