summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 08:26:31 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 16:03:15 (GMT)
commit37a8926fd8aa1971a4d0a8b04facf63c631b9367 (patch)
tree55acc48f9a0e4eab027aded502fcd3153fe7330e /src/gui
parent1c62dc421cf1ae45fe5089674b4d67fd0f1ff529 (diff)
downloadQt-37a8926fd8aa1971a4d0a8b04facf63c631b9367.zip
Qt-37a8926fd8aa1971a4d0a8b04facf63c631b9367.tar.gz
Qt-37a8926fd8aa1971a4d0a8b04facf63c631b9367.tar.bz2
fix warnings for the qreal == float case
Reviewed-by: mauricek
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h4
-rw-r--r--src/gui/styles/qstylehelper.cpp18
2 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index a4bbdd2..7415591 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -267,9 +267,9 @@ static inline void _q_adjustRect(QRectF *rect)
{
Q_ASSERT(rect);
if (!rect->width())
- rect->adjust(-0.00001, 0, 0.00001, 0);
+ rect->adjust(qreal(-0.00001), 0, qreal(0.00001), 0);
if (!rect->height())
- rect->adjust(0, -0.00001, 0, 0.00001);
+ rect->adjust(0, qreal(-0.00001), 0, qreal(0.00001));
}
static inline QRectF adjustedItemBoundingRect(const QGraphicsItem *item)
diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp
index 4877ec4..402c4d1 100644
--- a/src/gui/styles/qstylehelper.cpp
+++ b/src/gui/styles/qstylehelper.cpp
@@ -250,8 +250,8 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter)
QRadialGradient shadowGradient(shadowRect.center().x(),
shadowRect.center().y(), shadowRect.width()/2.0,
shadowRect.center().x(), shadowRect.center().y());
- shadowGradient.setColorAt(0.91, QColor(0, 0, 0, 40));
- shadowGradient.setColorAt(1.0, Qt::transparent);
+ shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40));
+ shadowGradient.setColorAt(qreal(1.0), Qt::transparent);
p->setBrush(shadowGradient);
p->setPen(Qt::NoPen);
p->translate(shadowSize, shadowSize);
@@ -263,8 +263,8 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter)
br.width()*1.3, br.center().x(),
br.center().y() - br.height()/2);
gradient.setColorAt(0, buttonColor.lighter(110));
- gradient.setColorAt(0.5, buttonColor);
- gradient.setColorAt(0.501, buttonColor.darker(102));
+ gradient.setColorAt(qreal(0.5), buttonColor);
+ gradient.setColorAt(qreal(0.501), buttonColor.darker(102));
gradient.setColorAt(1, buttonColor.darker(115));
p->setBrush(gradient);
} else {
@@ -290,21 +290,21 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter)
END_STYLE_PIXMAPCACHE
- QPointF dp = calcRadialPos(option, 0.70);
+ QPointF dp = calcRadialPos(option, qreal(0.70));
buttonColor = buttonColor.lighter(104);
- buttonColor.setAlphaF(0.8);
- const qreal ds = r/7.0;
+ buttonColor.setAlphaF(qreal(0.8));
+ const qreal ds = r/qreal(7.0);
QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds);
QRadialGradient dialGradient(dialRect.center().x() + dialRect.width()/2,
dialRect.center().y() + dialRect.width(),
dialRect.width()*2,
dialRect.center().x(), dialRect.center().y());
dialGradient.setColorAt(1, buttonColor.darker(140));
- dialGradient.setColorAt(0.4, buttonColor.darker(120));
+ dialGradient.setColorAt(qreal(0.4), buttonColor.darker(120));
dialGradient.setColorAt(0, buttonColor.darker(110));
if (penSize > 3.0) {
painter->setPen(QPen(QColor(0, 0, 0, 25), penSize));
- painter->drawLine(calcRadialPos(option, 0.90), calcRadialPos(option, 0.96));
+ painter->drawLine(calcRadialPos(option, qreal(0.90)), calcRadialPos(option, qreal(0.96)));
}
painter->setBrush(dialGradient);