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

setting global style sheet in main.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.4.2, 5.5.1
    • Fix Version/s: None
    • Component/s: Widgets: Style Sheets
    • Labels:
      None

      Description

      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

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes