Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, January 2008
TableWidget/View and selection colors


Message 1 in thread

Hi all, 

we're using different background colors to distinguish different types of 
cells in a table. If an user selects one or more cells, Qt shows the 
selection as blue cells, thus overriding the background colors. Using 
QPalette its easy to change style and color for the selection, but I haven't 
found a possibility to make the background color visible in the selected 
cells. My idea was it to use a transparent color: 

QPalette qp = palette();
qp.setBrush(QPalette::Highlight, QBrush(Qt::transparent, Qt::Dense7Pattern));
setPalette(qp);

but this also overwrites the background color of the table items. 

What am I doing wrong?

Mathias

--
 [ signature omitted ]