PDA

View Full Version : Change Color of Focus Frame



crybaby
15th October 2009, 21:40
Using Qt 4.5.3, I'm unable to change the color of the "focus frame" via a style sheet.

3749

Suggestions?

Background: My astronomy app changes the color of every screen element to either black or a shade of red, to preserve dark adaptation at the telescope. Qt's style sheets work really well to accomplish this task.

Thanks so much for your consideration.

axeljaeger
19th October 2009, 08:24
From the documentation:

"The color and background of the selected item is styled using selection-color and selection-background-color respectively."

Does this work for you?

crybaby
27th October 2009, 14:45
Thanks for taking the time to respond.


From the documentation:

"The color and background of the selected item is styled using selection-color and selection-background-color respectively."

Does this work for you?

Although these styles work as advertised, neither change the color of the focus frame rectangle that is drawn around the selection. (FWIW, I use the QListBox widget in the Qt Style Sheet example for testing.)

I've also tried altering QFocusFrame styles to no avail, which makes me think I'm still barking up the wrong tree.

axeljaeger
30th October 2009, 07:02
Does subclassing QStyle and reimplementing drawControl with argument "element" set to CE_FocusFrame work for you?