Fix the Mac build on 32bit with c++11

CGFloat is a float on 32bit and qreal is a double. This causes a
narrowing error when building with c++11 support.

Change-Id: Ia73378ff9798d1f547b37f97393564e2c9e3672d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Jocelyn Turcotte 2013-05-21 12:24:18 +02:00 committed by The Qt Project
parent 5d5a476e59
commit b2cce40b30

View File

@ -3643,8 +3643,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tti.version = qt_mac_hitheme_version;
tti.state = tds;
QColor textColor = btn->palette.buttonText().color();
CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
textColor.blueF(), textColor.alphaF() };
CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
CGContextSetFillColor(cg, colorComp);
tti.fontID = themeId;
@ -3883,8 +3883,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tti.version = qt_mac_hitheme_version;
tti.state = tds;
QColor textColor = myTab.palette.windowText().color();
CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
textColor.blueF(), textColor.alphaF() };
CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
CGContextSetFillColor(cg, colorComp);
switch (d->aquaSizeConstrain(opt, w)) {
@ -4063,8 +4063,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
CGContextSetShouldAntialias(cg, true);
CGContextSetShouldSmoothFonts(cg, true);
QColor textColor = p->pen().color();
CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
textColor.blueF(), textColor.alphaF() };
CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
CGContextSetFillColor(cg, colorComp);
HIThemeTextInfo tti;
@ -5379,8 +5379,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
tti.version = qt_mac_hitheme_version;
tti.state = tds;
QColor textColor = groupBox.palette.windowText().color();
CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
textColor.blueF(), textColor.alphaF() };
CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
CGContextSetFillColor(cg, colorComp);
tti.fontID = flat ? kThemeSystemFont : kThemeSmallSystemFont;