summaryrefslogtreecommitdiffstats
path: root/examples/effects
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-26 08:21:10 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-26 09:11:45 (GMT)
commit01255c3b33de2f72ff0b8802e8bea0ea79998f00 (patch)
treeb0cfa6f76522e4d19bd123658d4fec36545f42ce /examples/effects
parent6eb08228397400be1141611dd96cdad12161d016 (diff)
downloadQt-01255c3b33de2f72ff0b8802e8bea0ea79998f00.zip
Qt-01255c3b33de2f72ff0b8802e8bea0ea79998f00.tar.gz
Qt-01255c3b33de2f72ff0b8802e8bea0ea79998f00.tar.bz2
Make the 'effects' examples compile when qreal == float.
All of the types supplied to qBound() must be the same and in the case where qreal is typedef'ed to a float, this is not the case because the outer 2 arguments are considered doubles. We explicitly cast them to qreal to guarantee they are all the same type. Reviewed-by: bnilsen
Diffstat (limited to 'examples/effects')
-rw-r--r--examples/effects/blurpicker/blureffect.cpp2
-rw-r--r--examples/effects/customshader/blureffect.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/effects/blurpicker/blureffect.cpp b/examples/effects/blurpicker/blureffect.cpp
index f0fde49..0b806aa 100644
--- a/examples/effects/blurpicker/blureffect.cpp
+++ b/examples/effects/blurpicker/blureffect.cpp
@@ -52,7 +52,7 @@ BlurEffect::BlurEffect(QGraphicsItem *item)
void BlurEffect::adjustForItem()
{
qreal y = m_baseLine - item->pos().y();
- qreal radius = qBound(0.0, y / 32, 16.0);
+ qreal radius = qBound(qreal(0.0), y / 32, qreal(16.0));
setBlurRadius(radius);
}
diff --git a/examples/effects/customshader/blureffect.cpp b/examples/effects/customshader/blureffect.cpp
index 8e2a1fe..9923324 100644
--- a/examples/effects/customshader/blureffect.cpp
+++ b/examples/effects/customshader/blureffect.cpp
@@ -52,7 +52,7 @@ BlurEffect::BlurEffect(QGraphicsItem *item)
void BlurEffect::adjustForItem()
{
qreal y = m_baseLine - item->pos().y();
- qreal radius = qBound(0.0, y / 32, 16.0);
+ qreal radius = qBound(qreal(0.0), y / 32, qreal(16.0));
setBlurRadius(radius);
}