From 01255c3b33de2f72ff0b8802e8bea0ea79998f00 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 26 Aug 2009 10:21:10 +0200 Subject: 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 --- examples/effects/blurpicker/blureffect.cpp | 2 +- examples/effects/customshader/blureffect.cpp | 2 +- 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); } -- cgit v0.12