strtod() uses the locale's decimal point, which for
me is ','. But we want to always use '.' when parsing
color values for Context2D. qstrtod() does that.
This fixes two test failures in qquickcanvasitem.
Change-Id: I2ea58ad328f26903c57c7c80ed95fd24599805f4
Reviewed-by: Charles Yin <charles.yin@nokia.com>
the canvas.
\image qml-item-canvas-context.gif
*/
+
+Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
+
static const double Q_PI = 3.14159265358979323846; // pi
#define DEGREES(t) ((t) * 180.0 / Q_PI)
if (hasAlpha) {
if (*p++!= ',') return QColor();
while (isspace(*p)) p++;
- alpha = qRound(strtod(p, &p) * 255);
+ bool ok = false;
+ alpha = qRound(qstrtod(p, const_cast<const char **>(&p), &ok) * 255);
}
if (*p != ')') return QColor();