From 591f5353c88439594b9340226b4843d7ca2888ef Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 7 Oct 2009 11:48:08 +0200 Subject: Fix ASSERT caused by Plastique style when setting an application font with a pixel size Use QFontInfo to query the pointSize() instead of asking the font directly, fixing this assert: ASSERT failure in QFont::setPointSize: "point size must be greater than 0", file text/qfont.cpp, line 855 Task-number: QTBUG-3555 Reviewed-by: Simon Hausmann --- src/gui/styles/qplastiquestyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 349a60d..8e19022 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -3328,7 +3328,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op // Draw the text centered QFont font = painter->font(); - font.setPointSize(font.pointSize() - 1); + font.setPointSize(QFontInfo(font).pointSize() - 1); painter->setFont(font); painter->setPen(dockWidget->palette.windowText().color()); painter->drawText(titleRect, -- cgit v0.12