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

setting global style sheet in main.cpp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 5.4.2, 5.5.1
    • Widgets: Style Sheets
    • None

      When trying to set a font size for QWidget globally with a stylesheet in main.cpp on Windows 8 and Windows10 (maybe other versions are affected too, i only had these two for testing) and showing the main window maximized, the window is not set to maximezed, although the window title shows the maximized icon.

      As long as no font size for QWidget is set in the stylesheet everything is ok and window is shown maximized

      code ex:

      int main(int argc, char *argv[]) {
      QApplication a(argc, argv);
      QString style= "QWidget

      {font-size: 12pt}

      ";
      QApplication a(argc, argv);
      a.setStyleSheet(style);
      MainWindow w;
      w.showMaximized(); // this does not show a maximized window
      }

      If font size is set as application stylesheet in MainWindow it works as expected

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

            Unassigned Unassigned
            the_ Robert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes