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

Plastique style asserts when default font size set using pixelSize.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.1
    • 4.4.3
    • GUI: Look'n'Feel
    • None
    • 591f5353c88439594b9340226b4843d7ca2888ef

    Description

      If a global font is set for QApplication created using pixelSize, the following assert is triggered in QFont when trying to draw DockWidgets.

      ASSERT failure in QFont::setPointSize: "point size must be greater than 0", file text/qfont.cpp, line 855

      in drawControl() method for dockwidgets, there is an attempt to reduce font size by one, but code asks for pointSize, which returns -1 in this case.
      //from QPlastiqueStyle.cpp
      // Draw the text centered
      QFont font = painter->font();
      font.setPointSize(font.pointSize() - 1);
      painter->setFont(font);
      painter->setPen(dockWidget->palette.windowText().color());

      QFontInfo class should be used instead so point size can be queried successfully disregarding of the way the font was initialized.

      Attachments

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

        Activity

          People

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes