The Informative Text of a QMessageBox
can be formatted as rich text, and I understood that the html <font></font> tag was allowable for rich text in this context. However, the size attribute does not seem to work as expected. When used, the size of the QMessageBox
informative text is larger than normal, but the specific value seemingly has no effect (even though the attribute color, and the <i> & <b> tags seem to work as expected). Here's the output:
Is there a way to specify font sizes in html (or rtf) markup in the Informative Text of a QMessageBox
?
void MainWindow::about()
{
QMessageBox msgAbout;
msgAbout.setInformativeText("<span style='text-align: center'><p><b><font size = 20 color = red><i>Supposedly</i> set in 30pt font</font><p><font size = 20 color = blue><i>Rumoredly</i> set in 20pt font</font><p><font size = 10 color = green><i>Putatively</i> set in 10pt font</font><p>Proud not to use the <font> tag!</span><p>");
msgAbout.setStandardButtons(QMessageBox::Ok);
msgAbout.setDefaultButton(QMessageBox::Ok);
msgAbout.exec();
}
macOS 10.13.3
Qt Creator 4.5 based on Qt 5.10.0 (Clang 7.0 (Apple), 64 bit)