diff options
Diffstat (limited to 'src/declarative/items/context2d/qsgcontext2d.cpp')
-rw-r--r-- | src/declarative/items/context2d/qsgcontext2d.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp index e9cf65de84..cfcfb063dd 100644 --- a/src/declarative/items/context2d/qsgcontext2d.cpp +++ b/src/declarative/items/context2d/qsgcontext2d.cpp @@ -165,7 +165,13 @@ QColor qt_color_from_string(const QString& name) while (pos < len && !isdigit(data[pos])) pos++; if (pos >= len) return QColor(); - alpha = qRound(strtof(&(data[pos]), 0) * 255); +#ifndef Q_CC_MSVC + const float alphaF = strtof(data + pos, 0); +#else + // MSVC does not have strtof + const double alphaF = strtod(data + pos, 0); +#endif + alpha = qRound(alphaF * 255); } if (isRgb) |