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

Incorrect toolbar button size with style "Fusion" and font-size 13pt

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.6.0
    • GUI: Font handling
    • None
    • macOS

    Description

      When mac application has style "Fusion" and font-size 13pt, toolbar buttons(at least) a little bit smaller than they are supposed to be, and button text is cut.

      Minimal reproducible example:

      #include <QApplication>
      #include <QMainWindow>
      #include <QStyleFactory>
      #include <QToolBar>
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QApplication::setStyle(QStyleFactory::create("Fusion"));
          a.setStyleSheet("* {font-size:13pt}");
          QMainWindow w;
          QToolBar *toolbar = w.addToolBar("toolbar");
          toolbar->addAction("Hello, Cruel World!");
          w.show();
          return a.exec();
      }
      

      The bug appears only on macOS, only with style "Fusion" and only with font-size 13pt. I attached several screenshots:

      fail_fusion_13.png - the bug. Style "Fusion", font-size 13pt
      ok_default_13.png - expected behavior. Default style, font-size 13pt
      ok_fusion_14.png - expected behavior. Style "Fusion", font-size 14pt

      My system:

      $ uname -a
      Darwin MacBook-Pro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
      

      Maybe there is a workaround for this? Apart of setting different font size or style, of course.

      Attachments

        1. ok_fusion_14.png
          ok_fusion_14.png
          11 kB
        2. ok_default_13.png
          ok_default_13.png
          9 kB
        3. fail_fusion_13.png
          fail_fusion_13.png
          11 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            yrhetatejlb yrhetatejlb
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes