Important: Please read the Qt Code of Conduct -

Problem: font size changed with html font tag

  • in the Qtdesigner, I have a text label with font defined as "Ubuntu 12". in the code, if I just change the text of the lable, it is ok to display, such as "1234", no problem. but when I try to change the color of text with the html font tag, such "<font color="red">1234", the size of "1234" displayed on the screen became a little bigger because of bottom part of "1234" is wiped off. if I add size control in font tag, <font color="red" size=12">, the "1234" totally disappeard. how can I just changed the color with affect the size of label text? thanks

  • Moderators

    Try this:
    <span style="color: red">1234</span>

Log in to reply