Declarative: Compile fix for Windows.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Fri, 30 Sep 2011 12:46:12 +0000 (14:46 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sun, 2 Oct 2011 04:56:56 +0000 (06:56 +0200)
Change-Id: I0e4d61aa400094b3b059c836ee9145c1af989f00
Reviewed-on: http://codereview.qt-project.org/5881
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
src/declarative/items/context2d/qsgcontext2d.cpp
src/declarative/items/qsgtranslate.cpp

index e9cf65d..cfcfb06 100644 (file)
@@ -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)
index 1de5c6c..577cf4d 100644 (file)
@@ -296,7 +296,8 @@ void QSGRotation::setAxis(Qt::Axis axis)
     }
 }
 
-struct QGraphicsRotation {
+class QGraphicsRotation {
+public:
     static inline void projectedRotate(QMatrix4x4 *matrix, qreal angle, qreal x, qreal y, qreal z)
     {
         matrix->projectedRotate(angle, x, y, z);