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/styles | |
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/styles')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 10 |
2 files changed, 9 insertions, 9 deletions
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()) { |