summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp16
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp4
-rw-r--r--src/gui/graphicsview/qgridlayoutengine.cpp8
-rw-r--r--src/gui/graphicsview/qsimplex_p.cpp2
-rw-r--r--src/gui/image/qimage.cpp12
-rw-r--r--src/gui/kernel/qtooltip.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/painting/qcolor.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp8
-rw-r--r--src/gui/painting/qpaintengineex.cpp12
-rw-r--r--src/gui/painting/qpainter.cpp16
-rw-r--r--src/gui/painting/qrasterizer.cpp10
-rw-r--r--src/gui/painting/qtessellator.cpp2
-rw-r--r--src/gui/styles/qs60style.cpp8
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp10
-rw-r--r--src/gui/text/qfontdatabase.cpp4
-rw-r--r--src/gui/text/qfontengine.cpp4
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/widgets/qprogressbar.cpp2
21 files changed, 66 insertions, 66 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 9092593..cb7349c 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -8868,7 +8868,7 @@ QPainterPath QGraphicsEllipseItem::shape() const
return path;
if (d->spanAngle != 360 * 16) {
path.moveTo(d->rect.center());
- path.arcTo(d->rect, d->startAngle / 16.0, d->spanAngle / 16.0);
+ path.arcTo(d->rect, d->startAngle / qreal(16.0), d->spanAngle / qreal(16.0));
} else {
path.addEllipse(d->rect);
}
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 867880c..d652f25 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4304,7 +4304,7 @@ static void _q_paintItem(QGraphicsItem *item, QPainter *painter,
QGraphicsWidget *widgetItem = static_cast<QGraphicsWidget *>(item);
QGraphicsProxyWidget *proxy = qobject_cast<QGraphicsProxyWidget *>(widgetItem);
const qreal windowOpacity = (proxy && proxy->widget() && useWindowOpacity)
- ? proxy->widget()->windowOpacity() : 1.0;
+ ? proxy->widget()->windowOpacity() : qreal(1.0);
const qreal oldPainterOpacity = painter->opacity();
if (qFuzzyIsNull(windowOpacity))
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 548f79f..d2e21fb 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -298,7 +298,7 @@ inline int q_round_bound(qreal d) //### (int)(qreal) INT_MAX != INT_MAX for sing
return INT_MIN;
else if (d >= (qreal) INT_MAX)
return INT_MAX;
- return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1);
+ return d >= 0.0 ? int(d + qreal(0.5)) : int(d - int(d-1) + qreal(0.5)) + int(d-1);
}
void QGraphicsViewPrivate::translateTouchEvent(QGraphicsViewPrivate *d, QTouchEvent *touchEvent)
@@ -1830,14 +1830,14 @@ void QGraphicsView::centerOn(const QPointF &pos)
qint64 horizontal = 0;
horizontal += horizontalScrollBar()->minimum();
horizontal += horizontalScrollBar()->maximum();
- horizontal -= int(viewPoint.x() - width / 2.0);
+ horizontal -= int(viewPoint.x() - width / qreal(2.0));
horizontalScrollBar()->setValue(horizontal);
} else {
- horizontalScrollBar()->setValue(int(viewPoint.x() - width / 2.0));
+ horizontalScrollBar()->setValue(int(viewPoint.x() - width / qreal(2.0)));
}
}
if (!d->topIndent)
- verticalScrollBar()->setValue(int(viewPoint.y() - height / 2.0));
+ verticalScrollBar()->setValue(int(viewPoint.y() - height / qreal(2.0)));
d->lastCenterPoint = oldCenterPoint;
}
@@ -1886,22 +1886,22 @@ void QGraphicsView::ensureVisible(const QRectF &rect, int xmargin, int ymargin)
if (viewRect.left() <= left + xmargin) {
// need to scroll from the left
if (!d->leftIndent)
- horizontalScrollBar()->setValue(int(viewRect.left() - xmargin - 0.5));
+ horizontalScrollBar()->setValue(int(viewRect.left() - xmargin - qreal(0.5)));
}
if (viewRect.right() >= right - xmargin) {
// need to scroll from the right
if (!d->leftIndent)
- horizontalScrollBar()->setValue(int(viewRect.right() - width + xmargin + 0.5));
+ horizontalScrollBar()->setValue(int(viewRect.right() - width + xmargin + qreal(0.5)));
}
if (viewRect.top() <= top + ymargin) {
// need to scroll from the top
if (!d->topIndent)
- verticalScrollBar()->setValue(int(viewRect.top() - ymargin - 0.5));
+ verticalScrollBar()->setValue(int(viewRect.top() - ymargin - qreal(0.5)));
}
if (viewRect.bottom() >= bottom - ymargin) {
// need to scroll from the bottom
if (!d->topIndent)
- verticalScrollBar()->setValue(int(viewRect.bottom() - height + ymargin + 0.5));
+ verticalScrollBar()->setValue(int(viewRect.bottom() - height + ymargin + qreal(0.5)));
}
}
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index ca6713b..ec79a2f 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -482,8 +482,8 @@ static QSizeF closestAcceptableSize(const QSizeF &proposed,
minw = maxw;
minh = maxh;
}
- middlew = minw + (maxw - minw)/2.0;
- middleh = minh + (maxh - minh)/2.0;
+ middlew = minw + (maxw - minw)/qreal(2.0);
+ middleh = minh + (maxh - minh)/qreal(2.0);
min_hfw = minimumHeightForWidth(middlew, minh, maxh, widget);
diff --git a/src/gui/graphicsview/qgridlayoutengine.cpp b/src/gui/graphicsview/qgridlayoutengine.cpp
index 66b4a5b..5c61435 100644
--- a/src/gui/graphicsview/qgridlayoutengine.cpp
+++ b/src/gui/graphicsview/qgridlayoutengine.cpp
@@ -84,7 +84,7 @@ static qreal fixedDescent(qreal descent, qreal ascent, qreal targetSize)
Q_ASSERT(targetSize >= ascent + descent);
qreal extra = targetSize - (ascent + descent);
- return descent + (extra / 2.0);
+ return descent + (extra / qreal(2.0));
}
static qreal compare(const QGridLayoutBox &box1, const QGridLayoutBox &box2, int which)
@@ -292,9 +292,9 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz
int stretch = stretches[start + i];
if (sumStretches == 0) {
if (hasIgnoreFlag) {
- factors[i] = (stretch < 0) ? 1.0 : 0.0;
+ factors[i] = (stretch < 0) ? qreal(1.0) : qreal(0.0);
} else {
- factors[i] = (stretch < 0) ? sizes[i] : 0.0;
+ factors[i] = (stretch < 0) ? sizes[i] : qreal(0.0);
}
} else if (stretch == sumStretches) {
factors[i] = 1.0;
@@ -373,7 +373,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz
for (int i = 0; i < n; ++i) {
if (newSizes[i] < 0.0) {
- qreal delta = (sumFactors == 0.0) ? 0.0
+ qreal delta = (sumFactors == 0.0) ? qreal(0.0)
: sumCurrentAvailable * factors[i] / sumFactors;
newSizes[i] = sizes[i] + delta;
}
diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp
index eb8bcb8..1b45d9d 100644
--- a/src/gui/graphicsview/qsimplex_p.cpp
+++ b/src/gui/graphicsview/qsimplex_p.cpp
@@ -486,7 +486,7 @@ bool QSimplex::iterate()
// Normalize Pivot Row
qreal pivot = valueAt(pivotRow, pivotColumn);
if (pivot != 1.0)
- combineRows(pivotRow, pivotRow, (1.0 - pivot) / pivot);
+ combineRows(pivotRow, pivotRow, (qreal(1.0) - pivot) / pivot);
// Update other rows
for (int row=0; row < rows; ++row) {
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index a3378de..f527bcf 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -5908,12 +5908,12 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth
uchar *dptr, int dbpl, int p_inc, int dHeight,
const uchar *sptr, int sbpl, int sWidth, int sHeight)
{
- int m11 = int(trueMat.m11()*4096.0);
- int m12 = int(trueMat.m12()*4096.0);
- int m21 = int(trueMat.m21()*4096.0);
- int m22 = int(trueMat.m22()*4096.0);
- int dx = qRound(trueMat.dx()*4096.0);
- int dy = qRound(trueMat.dy()*4096.0);
+ int m11 = int(trueMat.m11()*qreal(4096.0));
+ int m12 = int(trueMat.m12()*qreal(4096.0));
+ int m21 = int(trueMat.m21()*qreal(4096.0));
+ int m22 = int(trueMat.m22()*qreal(4096.0));
+ int dx = qRound(trueMat.dx()*qreal(4096.0));
+ int dy = qRound(trueMat.dy()*qreal(4096.0));
int m21ydx = dx + (xoffset<<16) + (m11 + m21) / 2;
int m22ydy = dy + (m12 + m22) / 2;
diff --git a/src/gui/kernel/qtooltip.cpp b/src/gui/kernel/qtooltip.cpp
index f880243..178e7b1 100644
--- a/src/gui/kernel/qtooltip.cpp
+++ b/src/gui/kernel/qtooltip.cpp
@@ -184,7 +184,7 @@ QTipLabel::QTipLabel(const QString &text, QWidget *w)
setAlignment(Qt::AlignLeft);
setIndent(1);
qApp->installEventFilter(this);
- setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0);
+ setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / qreal(255.0));
setMouseTracking(true);
fadingOut = false;
reuseTip(text);
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 0aa1dfa..e015f5f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -11049,7 +11049,7 @@ bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const
qreal QWidget::windowOpacity() const
{
Q_D(const QWidget);
- return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0;
+ return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / qreal(255.) : qreal(1.0);
}
void QWidget::setWindowOpacity(qreal opacity)
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 3d895b7..2fe68a8 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -1578,7 +1578,7 @@ QColor QColor::toRgb() const
}
// chromatic case
- const qreal h = ct.ahsv.hue == 36000 ? 0 : ct.ahsv.hue / 6000.;
+ const qreal h = ct.ahsv.hue == 36000 ? 0 : ct.ahsv.hue / qreal(6000.);
const qreal s = ct.ahsv.saturation / qreal(USHRT_MAX);
const qreal v = ct.ahsv.value / qreal(USHRT_MAX);
const int i = int(h);
@@ -1638,7 +1638,7 @@ QColor QColor::toRgb() const
color.ct.argb.red = color.ct.argb.green = color.ct.argb.blue = 0;
} else {
// chromatic case
- const qreal h = ct.ahsl.hue == 36000 ? 0 : ct.ahsl.hue / 36000.;
+ const qreal h = ct.ahsl.hue == 36000 ? 0 : ct.ahsl.hue / qreal(36000.);
const qreal s = ct.ahsl.saturation / qreal(USHRT_MAX);
const qreal l = ct.ahsl.lightness / qreal(USHRT_MAX);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index bcc5f9d..0fea2da 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1649,8 +1649,8 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
if (lines[i].p1() == lines[i].p2()) {
if (s->lastPen.capStyle() != Qt::FlatCap) {
QPointF p = lines[i].p1();
- QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*0.5, p.y()),
- QPointF(p.x() + width*0.5, p.y())));
+ QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*qreal(0.5), p.y()),
+ QPointF(p.x() + width*qreal(0.5), p.y())));
d->rasterizer->rasterizeLine(line.p1(), line.p2(), 1);
}
continue;
@@ -5117,7 +5117,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
{
const qreal a = qreal(rect.width()) / 2;
const qreal b = qreal(rect.height()) / 2;
- qreal d = b*b - (a*a*b) + 0.25*a*a;
+ qreal d = b*b - (a*a*b) + qreal(0.25)*a*a;
int x = 0;
int y = (rect.height() + 1) / 2;
@@ -5140,7 +5140,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
pen_func, brush_func, pen_data, brush_data);
// region 2
- d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b);
+ d = b*b*(x + qreal(0.5))*(x + qreal(0.5)) + a*a*((y - 1)*(y - 1) - b*b);
const int miny = rect.height() & 0x1;
while (y > miny) {
if (d < 0) { // select SE
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 6df410b..eaedc4c 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -748,8 +748,8 @@ void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yR
qreal y2 = rect.bottom();
if (mode == Qt::RelativeSize) {
- xRadius = xRadius * rect.width() / 200.;
- yRadius = yRadius * rect.height() / 200.;
+ xRadius = xRadius * rect.width() / qreal(200.);
+ yRadius = yRadius * rect.height() / qreal(200.);
}
xRadius = qMin(xRadius, rect.width() / 2);
@@ -863,7 +863,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
for (int i=0; i<count; ++i) {
pts[++oset] = points[i].x();
pts[++oset] = points[i].y();
- pts[++oset] = points[i].x() + 1/63.;
+ pts[++oset] = points[i].x() + 1/qreal(63.);
pts[++oset] = points[i].y();
}
QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
@@ -873,7 +873,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() + 1/qreal(63.), points[i].y() };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}
@@ -894,7 +894,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount)
for (int i=0; i<count; ++i) {
pts[++oset] = points[i].x();
pts[++oset] = points[i].y();
- pts[++oset] = points[i].x() + 1/63.;
+ pts[++oset] = points[i].x() + 1/qreal(63.);
pts[++oset] = points[i].y();
}
QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
@@ -905,7 +905,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount)
} else {
for (int i=0; i<pointCount; ++i) {
qreal pts[] = { qreal(points[i].x()), qreal(points[i].y()),
- qreal(points[i].x() +1/63.), qreal(points[i].y()) };
+ qreal(points[i].x() +1/qreal(63.)), qreal(points[i].y()) };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index efb016e..fb5ce96 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -403,8 +403,8 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio
QPainterPath stroke = stroker.createStroke(originalPath);
strokeBounds = (stroke * state->matrix).boundingRect();
} else {
- strokeOffsetX = qAbs(penWidth * state->matrix.m11() / 2.0);
- strokeOffsetY = qAbs(penWidth * state->matrix.m22() / 2.0);
+ strokeOffsetX = qAbs(penWidth * state->matrix.m11() / qreal(2.0));
+ strokeOffsetY = qAbs(penWidth * state->matrix.m22() / qreal(2.0));
}
}
}
@@ -4460,8 +4460,8 @@ void QPainter::drawArc(const QRectF &r, int a, int alen)
QRectF rect = r.normalized();
QPainterPath path;
- path.arcMoveTo(rect, a/16.0);
- path.arcTo(rect, a/16.0, alen/16.0);
+ path.arcMoveTo(rect, a/qreal(16.0));
+ path.arcTo(rect, a/qreal(16.0), alen/qreal(16.0));
strokePath(path, d->state->pen);
}
@@ -4531,7 +4531,7 @@ void QPainter::drawPie(const QRectF &r, int a, int alen)
QPainterPath path;
path.moveTo(rect.center());
- path.arcTo(rect.x(), rect.y(), rect.width(), rect.height(), a/16.0, alen/16.0);
+ path.arcTo(rect.x(), rect.y(), rect.width(), rect.height(), a/qreal(16.0), alen/qreal(16.0));
path.closeSubpath();
drawPath(path);
@@ -4592,8 +4592,8 @@ void QPainter::drawChord(const QRectF &r, int a, int alen)
QRectF rect = r.normalized();
QPainterPath path;
- path.arcMoveTo(rect, a/16.0);
- path.arcTo(rect, a/16.0, alen/16.0);
+ path.arcMoveTo(rect, a/qreal(16.0));
+ path.arcTo(rect, a/qreal(16.0), alen/qreal(16.0));
path.closeSubpath();
drawPath(path);
}
@@ -9242,7 +9242,7 @@ void QPainter::drawPixmapFragments(const PixmapFragment *fragments, int fragment
qreal h = fragments[i].scaleY * fragments[i].height;
QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop,
fragments[i].width, fragments[i].height);
- drawPixmap(QRectF(-0.5 * w + xOffset, -0.5 * h + yOffset, w, h), pixmap, sourceRect);
+ drawPixmap(QRectF(qreal(-0.5) * w + xOffset, qreal(-0.5) * h + yOffset, w, h), pixmap, sourceRect);
}
setOpacity(oldOpacity);
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 1d3f581..ca10e6a 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -51,8 +51,8 @@
QT_BEGIN_NAMESPACE
typedef int Q16Dot16;
-#define Q16Dot16ToFloat(i) ((i)/65536.)
-#define FloatToQ16Dot16(i) (int)((i) * 65536.)
+#define Q16Dot16ToFloat(i) ((i)/qreal(65536.))
+#define FloatToQ16Dot16(i) (int)((i) * qreal(65536.))
#define IntToQ16Dot16(i) ((i) << 16)
#define Q16Dot16ToInt(i) ((i) >> 16)
#define Q16Dot16Factor 65536
@@ -701,7 +701,7 @@ static Q16Dot16 intersectPixelFP(int x, Q16Dot16 top, Q16Dot16 bottom, Q16Dot16
static inline bool q26Dot6Compare(qreal p1, qreal p2)
{
- return int((p2 - p1) * 64.) == 0;
+ return int((p2 - p1) * qreal(64.)) == 0;
}
static inline qreal qFloorF(qreal v)
@@ -1210,8 +1210,8 @@ void QRasterizer::rasterize(const QPainterPath &path, Qt::FillRule fillRule)
QRectF bounds = path.controlPointRect();
- int iTopBound = qMax(d->clipRect.top(), int(bounds.top() + 0.5 + (COORD_OFFSET - COORD_ROUNDING)/64.));
- int iBottomBound = qMin(d->clipRect.bottom(), int(bounds.bottom() - 0.5 + (COORD_OFFSET - COORD_ROUNDING)/64.));
+ int iTopBound = qMax(d->clipRect.top(), int(bounds.top() + qreal(0.5) + (COORD_OFFSET - COORD_ROUNDING)/qreal(64.)));
+ int iBottomBound = qMin(d->clipRect.bottom(), int(bounds.bottom() - qreal(0.5) + (COORD_OFFSET - COORD_ROUNDING)/qreal(64.)));
if (iTopBound > iBottomBound)
return;
diff --git a/src/gui/painting/qtessellator.cpp b/src/gui/painting/qtessellator.cpp
index 94a5128..15e4f65 100644
--- a/src/gui/painting/qtessellator.cpp
+++ b/src/gui/painting/qtessellator.cpp
@@ -1400,7 +1400,7 @@ void QTessellator::tessellateRect(const QPointF &a_, const QPointF &b_, qreal wi
if (delta.x == 0 && delta.y == 0)
return;
- qreal hw = 0.5 * width;
+ qreal hw = qreal(0.5) * width;
if (delta.x == 0) {
Q27Dot5 halfWidth = FloatToQ27Dot5(hw);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index eec2d15..59bd0dd 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1679,7 +1679,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWaitAnim,
painter, progressRect, flags | orientationFlag | QS60StylePrivate::SF_Animation );
} else {
- const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0
+ const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? qreal(1.0)
: (qreal)optionProgressBar->progress / optionProgressBar->maximum;
const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
if (optionProgressBar->orientation == Qt::Horizontal) {
@@ -2010,7 +2010,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (focusFrame->widget() && focusFrame->widget()->hasEditFocus())
editFocus = true;
}
- const qreal opacity = editFocus ? 1 : 0.75; // Trial and error factors. Feel free to improve.
+ const qreal opacity = editFocus ? 1 : qreal(0.75); // Trial and error factors. Feel free to improve.
#else
const qreal opacity = 0.85;
#endif
@@ -2148,8 +2148,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_IndicatorRadioButton: {
QRect buttonRect = option->rect;
//there is empty (a. 33%) space in svg graphics for radiobutton
- const qreal reduceWidth = (qreal)buttonRect.width() / 3.0;
- const qreal rectWidth = (qreal)option->rect.width() != 0 ? option->rect.width() : 1.0;
+ const qreal reduceWidth = (qreal)buttonRect.width() / qreal(3.0);
+ const qreal rectWidth = (qreal)option->rect.width() != 0 ? option->rect.width() : qreal(1.0);
// Try to occupy the full area
const qreal scaler = 1 + (reduceWidth/rectWidth);
buttonRect.setWidth((int)((buttonRect.width()-reduceWidth) * scaler));
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 7d2ed2a..c066631 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1247,20 +1247,20 @@ QPainterPath QRenderRule::borderClip(QRect r)
const QRectF rect(r);
const int *borders = border()->borders;
QPainterPath path;
- qreal curY = rect.y() + borders[TopEdge]/2.0;
+ qreal curY = rect.y() + borders[TopEdge]/qreal(2.0);
path.moveTo(rect.x() + tlr.width(), curY);
path.lineTo(rect.right() - trr.width(), curY);
- qreal curX = rect.right() - borders[RightEdge]/2.0;
+ qreal curX = rect.right() - borders[RightEdge]/qreal(2.0);
path.arcTo(curX - 2*trr.width() + borders[RightEdge], curY,
trr.width()*2 - borders[RightEdge], trr.height()*2 - borders[TopEdge], 90, -90);
path.lineTo(curX, rect.bottom() - brr.height());
- curY = rect.bottom() - borders[BottomEdge]/2.0;
+ curY = rect.bottom() - borders[BottomEdge]/qreal(2.0);
path.arcTo(curX - 2*brr.width() + borders[RightEdge], curY - 2*brr.height() + borders[BottomEdge],
brr.width()*2 - borders[RightEdge], brr.height()*2 - borders[BottomEdge], 0, -90);
path.lineTo(rect.x() + blr.width(), curY);
- curX = rect.left() + borders[LeftEdge]/2.0;
+ curX = rect.left() + borders[LeftEdge]/qreal(2.0);
path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2,
blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90);
@@ -3810,7 +3810,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if (inverted)
reverse = !reverse;
const bool indeterminate = pb->minimum == pb->maximum;
- qreal fillRatio = indeterminate ? 0.50 : qreal(progress - minimum)/(maximum - minimum);
+ qreal fillRatio = indeterminate ? qreal(0.50) : qreal(progress - minimum)/(maximum - minimum);
int fillWidth = int(rect.width() * fillRatio);
int chunkWidth = fillWidth;
if (subRule.hasContentsSize()) {
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 1d463c4..796c455 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1994,7 +1994,7 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
const QtFontSize *size = style->pixelSizes + l;
if (size->pixelSize != 0 && size->pixelSize != USHRT_MAX) {
- const uint pointSize = qRound(size->pixelSize * 72.0 / dpi);
+ const uint pointSize = qRound(size->pixelSize * qreal(72.0) / dpi);
if (! sizes.contains(pointSize))
sizes.append(pointSize);
}
@@ -2105,7 +2105,7 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
const QtFontSize *size = style->pixelSizes + l;
if (size->pixelSize != 0 && size->pixelSize != USHRT_MAX) {
- const uint pointSize = qRound(size->pixelSize * 72.0 / dpi);
+ const uint pointSize = qRound(size->pixelSize * qreal(72.0) / dpi);
if (! sizes.contains(pointSize))
sizes.append(pointSize);
}
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index c9b672b..8f46a80 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -381,9 +381,9 @@ void QFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rig
glyph_metrics_t gi = boundingBox(glyph);
bool isValid = gi.isValid();
if (leftBearing != 0)
- *leftBearing = isValid ? gi.x.toReal() : 0.0;
+ *leftBearing = isValid ? gi.x.toReal() : qreal(0.0);
if (rightBearing != 0)
- *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : 0.0;
+ *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : qreal(0.0);
}
glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 143dc1a..de2e27a 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -159,7 +159,7 @@ bool Qt::mightBeRichText(const QString& text)
QString Qt::escape(const QString& plain)
{
QString rich;
- rich.reserve(int(plain.length() * 1.1));
+ rich.reserve(int(plain.length() * qreal(1.1)));
for (int i = 0; i < plain.length(); ++i) {
if (plain.at(i) == QLatin1Char('<'))
rich += QLatin1String("&lt;");
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index dd92bda..1b0a1a1 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -462,7 +462,7 @@ QString QProgressBar::text() const
return result;
}
- int progress = (qreal(d->value) - d->minimum) * 100.0 / totalSteps;
+ int progress = (qreal(d->value) - d->minimum) * qreal(100.0) / totalSteps;
result.replace(QLatin1String("%p"), QString::number(progress));
return result;
}