View Full Version : QTableWidget, header behavior

14th October 2006, 01:09

I'm trying to port a Qt3 app to Qt4. I would like the QTableWidget to look like Q3Table. By default QTableWidget will select a column header(make it look darker) when you select a row. I would like to disable this behavior so the header look doesn't change when you select a row.


14th October 2006, 09:03
There are two possibilities. Either modify the palette of the header (you can access the header through horizontalHeader() or verticalHeader()) and if this doesn't work, simply subclass QHeaderView and reimplement its painting so that it ignores the selected state for sections. You'll have to subclass QTableWidget itself too so that you can assign the new header instead of the original one.