qt - How to set stylesheet for the current item in QTableView -


when qtableview edit control visible current item shylesheet of edit takes place. when there no active edit control in qtableview current item styled using qtableview { selection-background-color: } how set different style current item?

current item visible when qtableview has focus active edit-box on current item

qt style sheets support sub-controls , pseudo states, can use improve customization. (see http://qt-project.org/doc/qt-5/stylesheet-reference.html#list-of-pseudo-states )

in case can use ::item sub-control , :focus pseudo state (the "current" pseudo state doesn't exist, :focus same).

this example can use:

qtableview::item:focus {    selection-background-color: yellow; } 

enter image description here

see http://qt-project.org/doc/qt-5/stylesheet-examples.html#customizing-qtreeview


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -