Qt5 GUI How To Create QFontDialog
In this Qt5 GUI i want to show you How To Create QFontDialog. The QFontDialog class provides a dialog widget for selecting a font. A font dialog is created through one of the static getFont() functions. Example:
1 2 3 4 5 6 7 8 9 |
bool ok; QFont font = QFontDialog::getFont( &ok, QFont("Helvetica [Cronyx]", 10), this); if (ok) { // the user clicked OK and font is set to the font the user selected } else { // the user canceled the dialog; font is set to the initial // value, in this case Helvetica [Cronyx], 10 } |
Also …