From a34d372b45d75a32dcc300dbb7f8151e15df4294 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 11 Jan 2010 14:49:39 +0100 Subject: Fixes warning in the QMacStyle Warning such as QFont::setPointSizeF: Point size <= 0 (-1.000000), must be greater than 0 because the font size might be specified in pixel, and pointSizeF returns -1 if the font size is in pixel (as documented) Reviewed-by: jbache Task-number: QTBUG-7263 --- src/gui/styles/qcleanlooksstyle.cpp | 2 +- src/gui/styles/qmacstyle_mac.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index b08847d..78beb5b 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -2069,7 +2069,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o // This is mainly to handle cases where someone sets the font on the window // and then the combo inherits it and passes it onward. At that point the resolve mask // is very, very weak. This makes it stonger. - font.setPointSizeF(menuItem->font.pointSizeF()); + font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) font.setBold(true); diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 4075cf7..25e3028 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3996,7 +3996,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // This is mainly to handle cases where someone sets the font on the window // and then the combo inherits it and passes it onward. At that point the resolve mask // is very, very weak. This makes it stonger. - myFont.setPointSizeF(mi->font.pointSizeF()); + myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF()); p->setFont(myFont); p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1, contentRect.height(), text_flags ^ Qt::AlignRight, s); -- cgit v0.12