QFont myFont("Arial", 12); // create QFont object with font family "Arial" and size of 12 myFont.setPointSize(14); // set the point size to 14
QFont myFont("Georgia", 16, QFont::Bold); // create QFont object with font family "Georgia", size of 16 and bold style int fontSize = myFont.pointSize(); // retrieve the point size and assign it to a variableBoth examples are using the QFont class from the Qt package library to set or retrieve the point size of a QFont object.