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

QTabWidget tab titles don't inherit QApplication font size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.9.1
    • None
    • MacOS X 10.11.6, MacBook Pro Retina
    • macOS

      On MacOS X 10.11, the following code:

       

       

      #include <QApplication>
      #include <QTabWidget>
      #include <QLabel>
      #include <QMainWindow>
      #include <QFont>
      
      int main(int argc, char *argv[]) {
      
      QApplication app(argc, argv);
      
      QMainWindow *window = new QMainWindow;
      
      QFont font = app.font();
      font.setPointSize(6);
      app.setFont(font);
      
      QLabel *label = new QLabel;
      label->setText("This is a text label");
      
      QTabWidget *tabs = new QTabWidget;
      tabs->addTab(label, "This is a tab");
      
      window->setCentralWidget(tabs);
      
      window->show();
      window->raise();
      return app.exec();
      }
      

       

      results in the attached screenshot. The issue is that while the QLabel correctly inherits the QApplication font size, the title of the tab does not.

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

            esabraha Eskil Abrahamsen Blomfeldt
            trobitaille trobitaille
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes