When using a QLabel element filled with some html text, I have a problem: it does not simply render the HTML, it inserts some space around the html text.
The following renders ok:
A simple text!
The following fails:
A <strong>HTML</strong> text!
Actually, Qt renders everything okay, but always I have html in my text, there are some space around my text, however, in my application, this space becomes a real problem. All CSS I've tried fails, maybe I just do not know the exactly way to style it.
Are you setting the text using setText() function? If you pass a QString which contains rich text in setText() parameter, the rich text is supposed to be rendered. If not, you can try to set the QLabel's textFormat to Qt::RichText.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With