Fix compilation on ARM with C++11: narrowing conversion

Cannot have double-to-float conversions inside { } in C++11.

Change-Id: I13c27307efd703420b6667d919bb42c2ee82e6cc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Thiago Macieira 2011-12-29 17:59:01 -02:00 committed by Qt by Nokia
parent 76f2aa139a
commit 31f9df5205
3 changed files with 3 additions and 3 deletions

View File

@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
}
} else {
for (int i=0; i<pointCount; ++i) {
qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 1/63., points[i].y() };
qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}

View File

@ -2399,7 +2399,7 @@ QDataStream &operator>>(QDataStream &s, QPainterPath &p)
#endif
continue;
}
QPainterPath::Element elm = { x, y, QPainterPath::ElementType(type) };
QPainterPath::Element elm = { qreal(x), qreal(y), QPainterPath::ElementType(type) };
p.d_func()->elements.append(elm);
}
s >> p.d_func()->cStart;

View File

@ -268,7 +268,7 @@ inline void QPainterPathData::maybeMoveTo()
}
}
#define KAPPA 0.5522847498
#define KAPPA qreal(0.5522847498)
QT_END_NAMESPACE