diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-10-17 23:00:33 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-10-17 23:00:33 (GMT) |
commit | 923693d4919f22eabd5cec8fb6e855514bb64fb7 (patch) | |
tree | ce5c6ec3f89b9bef3684c748bc4bc39af0d53a9a /src/gui/graphicsview | |
parent | ec9a31abf003880a60d1120738a3bee7075b8ca8 (diff) | |
parent | 09e7218a1c30ca33a5d82280f89f07ba54b96555 (diff) | |
download | Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.zip Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.gz Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 16 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget_p.cpp | 4 | ||||
-rw-r--r-- | src/gui/graphicsview/qgridlayoutengine.cpp | 8 | ||||
-rw-r--r-- | src/gui/graphicsview/qsimplex_p.cpp | 2 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index f7ae045..73e8eed 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -8870,7 +8870,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) { |