0
SequentialAnimation
をListView
という特定のItem
にトリガーしようとしました。例えばリストビュー内の1つのアイテムでアニメーションをトリガーする方法
は:
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
}
}
}
}
}
私はあなたがボタンをクリックしたときAnimation
をトリガーしようとするが、私はAnimation
にcondition
を使用する方法がわかりません。 どうすればいいですか?
ありがとうございます! また、 'target:myItem;を追加する必要があります。プロパティ: "color"; 'ColorAnimation' –
@dtech次のように私を助けてください:http://stackoverflow.com/questions/43918657/how-to-smoothly-load-lines-with-customized-scrollbar -event-in-qt –
@dtechどんな助力も深く感謝します。 –