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

Got wrong default-font after qApp->setFont () on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.12
    • GUI: Font handling
    • None
    • Qt5.12.2
    • macOS

    Description

      Hi there,
      I have installed the font "JetBrains Mono" on windows10, centos8 and macOS 11.2.3. The application UI got correct font on both windows10 and centos8 after I change the default font of application. But the application UI got wrong font on macOS. the code as following

      QString cJetBrainsMono ("JetBrains Mono");
      QFont defaultFont (cJetBrainsMono, 8);
      qApp->setFont (defaultFont);
      if (qApp->font ().family ().compare (cJetBrainsMono) != 0)
      qApp->setFont (QFontDatabase::systemFont (QFontDatabase::FixedFont));

      PS: in debug mode, qApp->font ().family ().compare (cJetBrainsMono) is true on macOS, UI with wrong font

      Attachments

        1. macOS.jpg
          macOS.jpg
          96 kB
        2. win10.PNG
          win10.PNG
          76 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            james.lin James Lin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes