Pablo1517
21st November 2014, 12:08
Hello. I have a QStandardItemModel, with QStandardItems in it, all in QTableView.
I have to make certain column headers to be different color and possibly different text. Let's post an example table then:
10756
As you can see first colum and first row font is different because I tried changing color and other stuff in it with this:
QStandardItem *col1 = new QStandardItem("Column 1");
col1->setForeground(Qt::red);
col1->setBackground(Qt::green);
col1->setFont(QFont("arial", 11));
setHorizontalHeaderItem(0, col1);
So changing font works just fine, but colors, nope...
any ideas?
I have to make certain column headers to be different color and possibly different text. Let's post an example table then:
10756
As you can see first colum and first row font is different because I tried changing color and other stuff in it with this:
QStandardItem *col1 = new QStandardItem("Column 1");
col1->setForeground(Qt::red);
col1->setBackground(Qt::green);
col1->setFont(QFont("arial", 11));
setHorizontalHeaderItem(0, col1);
So changing font works just fine, but colors, nope...
any ideas?