OSDN Git Service

QmlDesigner.propertyEditor: read gradient data from model
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Wed, 22 Dec 2010 16:35:20 +0000 (17:35 +0100)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Wed, 22 Dec 2010 16:38:51 +0000 (17:38 +0100)
We are reading gradient data from the model instead of the instances now.
This avoids problems with asynchronous implementation and is feature wise the same.

src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp

index 1fa1714..09403f7 100644 (file)
@@ -61,8 +61,8 @@ void GradientLineQmlAdaptor::setupGradient()
         foreach (const ModelNode &stopNode, stopList) {
             QmlObjectNode stopObjectNode = stopNode;
             if (stopObjectNode.isValid()) {
-                qreal position = stopObjectNode.instanceValue("position").toReal();
-                QColor color = stopObjectNode.instanceValue("color").value<QColor>();
+                qreal position = stopNode.variantProperty("position").value().toReal();
+                QColor color = stopNode.variantProperty("color").value().value<QColor>();
                 stops.append( QPair<qreal, QColor>(position, color));
             }
         }