The text value of a QPushButton
is not "rich text" so it will not interpret your html as expected. Either use the setFont
on your widget to set the font size, or set it via a style sheet:
QFont font = ui->pushButton->font();
font.setPointSize(16);
ui->pushButton->setFont(font);
Style sheets, while more powerful, can tend to be a bit more complex because it forces you to define a number of other features that you are now over-writting.