, blockRunningChanged(false) {}
QDeclarativeProperty property;
- QVariant currentValue;
QVariant targetValue;
QDeclarativeGuard<QDeclarativeAbstractAnimation> animation;
bool enabled;
if (d->animation->isRunning() && value == d->targetValue)
return;
- d->currentValue = d->property.read();
+ const QVariant ¤tValue = d->property.read();
d->targetValue = value;
if (d->animation->qtAnimation()->duration() != -1
QDeclarativeStateOperation::ActionList actions;
QDeclarativeAction action;
action.property = d->property;
- action.fromValue = d->currentValue;
+ action.fromValue = currentValue;
action.toValue = value;
actions << action;
{
Q_D(QDeclarativeBehavior);
d->property = property;
- d->currentValue = property.read();
if (d->animation)
d->animation->setDefaultTarget(property);
void replaceBinding();
//void transitionOverrides();
void group();
+ void valueType();
void emptyBehavior();
void explicitSelection();
void nonSelectingBehavior();
}
}
+void tst_qdeclarativebehaviors::valueType()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("valueType.qml")));
+ QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
+ QVERIFY(rect);
+
+ //QTBUG-20827
+ QCOMPARE(rect->color(), QColor::fromRgb(255,0,255));
+
+ delete rect;
+}
+
void tst_qdeclarativebehaviors::emptyBehavior()
{
QDeclarativeEngine engine;