How to change background color of QTableWidget horizontalHeaderItem?
Hi! I'm trying to change the background color of my QTableWidget horizontal header item but it's not working.
Code:
tblCol1->setBackground(Qt::red);
tableWidget->setHorizontalHeaderItem(0, tblCol1);
Is there other way to do this?
thanks..
1 Attachment(s)
Re: How to change background color of QTableWidget horizontalHeaderItem?
Works fine here.
Code:
#include <QtGui/QApplication>
#include <QTableWidget>
int main(int argc, char *argv[])
{
tblCol1->setBackground(Qt::red);
tableWidget.setHorizontalHeaderItem(0, tblCol1);
tableWidget.show();
return a.exec();
}
Attachment 4911
Re: How to change background color of QTableWidget horizontalHeaderItem?
I've tried to compile the same source code in WINDOWS and LINUX(Ubuntu) using Qt 4.6.1 but both are not working..:confused:
Re: How to change background color of QTableWidget horizontalHeaderItem?
That screen shot is from a Debian Sid box running Qt 4.7 Beta 1. I just tried it on Windows XP running Qt 4.6.2 and the background wasn't changed. :confused: indeed!
Re: How to change background color of QTableWidget horizontalHeaderItem?