定时

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" }
        }
    ]
}

 

posted on 2013-03-01 17:55  小风儿_xf  阅读(189)  评论(0编辑  收藏  举报

导航