[Qt-interest] setData function to change color

Nikos Geronitidis geronik444 at gmail.com
Thu Oct 15 12:13:58 CEST 2009


Hello list

I am trying to change the color of specific fields in a *QTableView*, with
the *setData* function.

I have made a subclass of QSqlQueryModel named CustomSqlQueryModel
and inside the constructor I use the following loop in order to change the
color:

*for (int i = 0; i < rowCount(); i++)
setData(index(i,1),QColor(Qt::red),Qt::TextColorRole));*

but this is not working, am I missing something?
thanks in advance.


-- 
Best Regards
Nikos Gerontidis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091015/0a15ad7f/attachment.html 


More information about the Qt-interest-old mailing list