PDA

View Full Version : How to color a particular column which has pixmap in a QTableView



anbu01
4th August 2015, 09:45
I have a custom table view class which has the structure such that the first and third columns are lineedit and second and third columns are buttons . I just want to color the text of the buttons even though when it is not selected . In delegate , Paint() method colors the 2nd and 4th columns as a pixmap not as a buttons so i want to color the text of a pixmap . Can any one help on it ?

prasad_N
4th August 2015, 13:28
Below code sets the fore ground color(text) to push button.
You could try something like this.


QPushButton *button = new QPushButton("Button");
button->setPalette(*palette);
QPalette* palette = new QPalette();
palette->setColor(QPalette::ButtonText,Qt::red);