[Interest] Setting current item text color via stylesheet in QTableView for SelectRows

Patrick Stinson patrickkidd at gmail.com
Wed Aug 8 01:31:42 CEST 2018


Hello!

I have a vanilla QTableView with SingleSelection and SelectRows and am trying to figure out how to set the text color of the current item for both when the row is selected and when it isn’t. This is important so that the user knows which cell will be edited when they hit the enter key and so they can navigate to a new cell using the arrow keys.

It seems that the following will do it, but it doesn’t apply when the row is selected.

QTableView::item:focus {                                                                                                                                                          
    color: yellow;                                                                                                                                                                
}

How can this be done?

Thanks!
-Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180807/cb6472c3/attachment.html>


More information about the Interest mailing list