From: Olivier Goffart Date: Wed, 29 Jun 2011 16:20:52 +0000 (+0200) Subject: Fix compilation X-Git-Tag: qt-v5.0.0-alpha1~2156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b84efd6c321b9e7ffb850bae3eebb8325eac725;p=profile%2Fivi%2Fqtdeclarative.git Fix compilation qsgdefaultrectanglenode.cpp:221:22: error: narrowing conversion of '(((& c)->QColor::redF() * (&c)->QColor::alphaF()) * 2.55e+2)' from 'qreal {aka double}' to 'unsigned char' inside { } [-fpermissive] Change-Id: I4f051f07d5db28fd03739343c255cc72d968a99d Reviewed-on: http://codereview.qt.nokia.com/1004 Reviewed-by: Qt Sanity Bot Reviewed-by: Kim M. Kalland --- diff --git a/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp b/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp index 34a6db4..a153a11 100644 --- a/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp +++ b/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp @@ -214,10 +214,10 @@ Color4ub operator +(Color4ub a, Color4ub b) { a.a += b.a; a.r += b.r; a.g += b. static inline Color4ub colorToColor4ub(const QColor &c) { - Color4ub color = { c.redF() * c.alphaF() * 255, - c.greenF() * c.alphaF() * 255, - c.blueF() * c.alphaF() * 255, - c.alphaF() * 255 + Color4ub color = { uchar(c.redF() * c.alphaF() * 255), + uchar(c.greenF() * c.alphaF() * 255), + uchar(c.blueF() * c.alphaF() * 255), + uchar(c.alphaF() * 255) }; return color; }