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

Plastique style asserts when default font size set using pixelSize.

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes