Stylesheet issue - setting color property in the :focus state
-
I've just found the next strange issue working with style sheets.
Using the following code, the text color is changed to red in
QLineEdit
but not inQTextEdit
when the focus is got. In both cases, the background is OK. Does anyone know the reason why?QTextEdit:focus { color: red; background-color: grey; } QLineEdit:focus { color: red; background-color: grey; }
-
@tarod.net said:
QTextEdit
HI , I think the text color is part of the html so that is why it has no effect.
please see
https://forum.qt.io/topic/23189/qtextedit-text-color -
@mrjj Well, but the text color changes if I use next code instead:
QTextEdit { color: red; background-color: grey; }
So I don't know why, but the text color doesn't change when the property is set, for example, in the
:focus
or:hover
state.Maybe it's a bug?
-
This post is deleted!
-
@tarod.net said:
:focus
Not sure if it a bug or by design. Seem that color does not work for :focus for QTextEdit
Here they control the focus color with codehttp://stackoverflow.com/questions/32060606/can-a-stylesheet-change-text-color-in-a-qplaintextedit
Could be a bug since it is strange that color does for for normal state.
-
@tarod.net
Heh. Just saw the picture now...sorry.I searched the bug database but i see nothing that sounds like this.