QLabel text not visible
-
I have a QLabel whose stylesheet is set to:
"background: qcolor(rgba(0,0,0,0))"
When the text was set to:
"<Click here to select the Monitored Folder>"it was visible.
But when I changed the text to:
"<a href='.' style='text-decoration: none; color: #0000ff'><Click here to select the Monitored Folder></a>"it was no longer visible.
What have I missed?
-
I have a QLabel whose stylesheet is set to:
"background: qcolor(rgba(0,0,0,0))"
When the text was set to:
"<Click here to select the Monitored Folder>"it was visible.
But when I changed the text to:
"<a href='.' style='text-decoration: none; color: #0000ff'><Click here to select the Monitored Folder></a>"it was no longer visible.
What have I missed?
@Perdrix
Your second case is definitely HTML/rich text (first case could be plain text only,QLabeldoes both). Are you sure that supplying literal text inside<...>is legit for HTML/Qt's rich text? You should really be HTML entitizing those, does that make any difference...? -
@Perdrix
Your second case is definitely HTML/rich text (first case could be plain text only,QLabeldoes both). Are you sure that supplying literal text inside<...>is legit for HTML/Qt's rich text? You should really be HTML entitizing those, does that make any difference...? -
P Perdrix has marked this topic as solved on
-
@JonB It was precisely that! Thank you.
When I removed the <> from the original text it all worked. The background colour was a red herring!
-
@Perdrix said in QLabel text not visible:
The background colour was a red herring!
Actually it was a blue herring....
-
@JonB It was precisely that! Thank you.
When I removed the <> from the original text it all worked. The background colour was a red herring!
@Perdrix said in QLabel text not visible:
When I removed the <>
If you still need
< ... >around your text (which was also in your text before), I think it can be done by escaping the characters / replacing them with<( ' <' ) and>( '>' ).
Not tested but should work. -
@Perdrix
Your second case is definitely HTML/rich text (first case could be plain text only,QLabeldoes both). Are you sure that supplying literal text inside<...>is legit for HTML/Qt's rich text? You should really be HTML entitizing those, does that make any difference...? -
escaping the characters / replacing them with
@JonB said in QLabel text not visible:
You should really be HTML entitizing those, does that make any difference...?
That's what "entitizing" means :)