diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-01-11 13:49:39 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-01-11 14:04:49 (GMT) |
commit | a34d372b45d75a32dcc300dbb7f8151e15df4294 (patch) | |
tree | 03b022318fc6f6041079c1926b2f6e0ff9116c44 /src | |
parent | 820db2b2c5a0fc470fa5759d95ea49305ec98654 (diff) | |
download | Qt-a34d372b45d75a32dcc300dbb7f8151e15df4294.zip Qt-a34d372b45d75a32dcc300dbb7f8151e15df4294.tar.gz Qt-a34d372b45d75a32dcc300dbb7f8151e15df4294.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
Diffstat (limited to 'src')
-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 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); |