QFont font("Arial", 12); font.setCapitalization(QFont::AllUppercase);
QFont font("Times New Roman", 10); font.setCapitalization(QFont::SmallCaps);This code creates a QFont object with Times New Roman font and 10-point size, then sets its capitalization attribute to SmallCaps. This will use small capitals to represent the text displayed using this QFont object. These examples are using the Qt library.