QFont font("Arial"); font.setStyleHint(QFont::Serif);
QFont font("Helvetica"); font.setStyleHint(QFont::Monospace);
QFont font("Times New Roman"); font.setStyleHint(QFont::Times);In this example, we create a QFont object with "Times New Roman" as the font family. Then, we set the style hint to QFont::Times using setStyleHint function. This will give a hint to the font rendering system to look for a times font to render the text. Package library: Qt