Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87483

QFontDialog::selectedFont() Does not returns Actual selected Font

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      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();
       } 

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes