Hiya,
I have a simple use case where I want to animate the color of an item
in a loop back and forth. I can do this fine using PropertyAnimation,
but it doesn't work when I use ColorAnimation. I've attached a very
simple example showing what I mean. Does anyone know what the issue is
here? Using ColorAnimation instead of PropetyAnimation results in
nothing happening -- no error message or anything like that, whereas
PropertyAnimation cycles the colors as expected.
Regards,
Preet
// ============================================================== //
import QtQuick 2.1
Rectangle
{
id: root;
width: 800; height: 480;
color: "#333333";
Rectangle {
id: rect;
width: 200; height: 200;
anchors.centerIn: parent;
color: "#71C837";
}
SequentialAnimation {
running: true;
loops: Animation.Infinite;
PropertyAnimation {
target: rect; property: "color";
from: "#71C837"; to: "#5FD3BC";
duration: 500;
}
PropertyAnimation {
target: rect; property: "color";
from: "#5FD3BC"; to: "#71C837";
duration: 500;
}
}
// Why doesn't ColorAnimation work like
// the above PropertyAnimation?
/*
SequentialAnimation {
running: true;
loops: Animation.Infinite;
ColorAnimation {
target: rect;
from: "#71C837";
to: "#5FD3BC";
duration: 500;
}
ColorAnimation {
target: rect;
from: "#5FD3BC";
to: "#71C837";
duration: 500;
}
}
*/
}
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest