I’m trying to do something simple that’s not working out. I have text that turns from “white” to “yellow” when the user focus it. Now, I want it to flash green briefly when the user changes the value by key press. I thought it would just be:
Item
{
Text {
id: value_text;
color: "white";
}
ColorAnimation {
id: key_press_animation;
target: value_text;
from: "green";
to: "yellow";
}
states: [
State {
name: "FOCUS";
when: ...
PropertyChanges { target: value_text; color: "yellow"; }
}
]
Keys.onPressed: {
key_press_animation.restart();
}
}
I am using states and I think that is messing something up. What am I missing?
↧