定时
import QtQuick 2.0 Rectangle { id: myRect width: 100; height: 100 color: "black" Timer { id: time; repeat: true interval: 1000 ; running: true; onTriggered: { myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked'} } states: [ State { name: "clicked" PropertyChanges { target: myRect; color: "red" } } ] }