diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-01-11 13:49:39 (GMT) |
---|---|---|
committer | Jesper Thomschutz <jesper.thomschutz@nokia.com> | 2010-01-13 13:32:49 (GMT) |
commit | 0ec72635452e743796b5ff3c91bc66faa7d7f90a (patch) | |
tree | 314845dade20f5fb23f358a95ebc32253fb626ab | |
parent | 8ea10d62722a16282b03cdea6918d811501a7812 (diff) | |
download | Qt-0ec72635452e743796b5ff3c91bc66faa7d7f90a.zip Qt-0ec72635452e743796b5ff3c91bc66faa7d7f90a.tar.gz Qt-0ec72635452e743796b5ff3c91bc66faa7d7f90a.tar.bz2 |
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
(cherry picked from commit a34d372b45d75a32dcc300dbb7f8151e15df4294)
-rw-r--r-- | src/gui/styles/qcleanlooksstyle.cpp | 2 | ||||
-rw-r--r-- | 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 b5b25f7..9e0f0b4 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 6fd580b..bec7bc0 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); |