Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.1
-
Desktop
-
-
407e171b40c3be3036ef71227d43c49f0b8d5788 (qt/qtbase/dev) d9e3281115b7c574dfb30c5094a8f9441bd60e35 (qt/qtbase/5.15)
Description
Document says QFontDialog::selectedFont() will return user selected font but actully this does not. In fact currentFont() does returns the selected font.
https://doc.qt.io/qt-5/qfontdialog.html#selectedFont
#include <QApplication> #include <QFontDialog> #include <QDebug> int main(int argc, char **argv) { QApplication app(argc, argv); QFont f; qDebug() << f; QFontDialog *dialog = new QFontDialog(f); dialog->connect(dialog, &QFontDialog::accepted, [dialog]() { qDebug() << dialog->selectedFont() << dialog->currentFont(); } ); dialog->open(); return app.exec(); }