通过景观台函数getFont创建的字体对话框
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
}
对话框也可以呗设置到widget里
myWidget.setFont(QFontDialog::getFont(0, myWidget.font()));
如果用户点击ok,字体将会呗应用到myWidget,并且如果他们点击取消,将不会应用