J'essaie de déclencher une SequentialAnimation
sur une donnée Item
d'un ListView
.Comment déclencher l'animation d'un élément dans une ListView
Par exemple:
ApplicationWindow {
id: window
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ListModel {
id: modelList
ListElement {}
ListElement {}
ListElement {}
}
ListView {
width: window.width
height: window.height
model: modelList
delegate: Rectangle {
width: window.width
height: window.height/10
color: "red"
radius : 10
SequentialAnimation on color { //Should be only triggered when button clicked
ColorAnimation { to: "yellow"; duration: 1000 }
ColorAnimation { to: "red"; duration: 1000 }
}
Button {
text: "trigger animation"
anchors{
right: parent.right
top: parent.top
bottom: parent.bottom
margins: 10
}
onClicked: {
//Trigger SequentialAnimation
}
}
}
}
}
J'essaie de déclencher le Animation
lorsque vous cliquez sur le bouton mais je ne sais pas comment utiliser un condition
sur un Animation
. Comment pourrais-je procéder?
Merci ça marche! Je dois aussi ajouter 'target: myItem; propriété: "couleur"; 'dans 'ColorAnimation' –
@dtech Pourriez-vous s'il vous plaît aidez-moi avec ce qui suit: http://stackoverflow.com/questions/43918657/how-to-smoothly-load-lines-with-customized-scrollbar -event-in-qt –
@dtech Toute aide serait grandement appréciée. –