PDA

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



anbu01
4th August 2015, 09:31
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 ?

west
4th August 2015, 23:01
I am not sure if I understood you but maybe try this:
http://doc.qt.io/qt-5/qabstractitemmodel.html#data
with Qt::ForegroundRole