import QtQuick 2.0
import MyModule 1.0
import QtQuick.Shapes

Rectangle {
    width: 1280
    height: 400
    property bool flag: false

    MyDataTest {
        id: uartData
        onGetData: {
            //console.log("lzy qml test : ")
        }
    }

    Timer {
        id: timer_data
        interval: 1000
        running: true
        repeat: false

        onTriggered: {
            // uartData.testData()
            uartData.init()
            uartData.testData()
            console.log("lzy qml test Timer: ")
        }
    }



    Timer {
        id: timer
        interval: 500
        running: false
        repeat: true

        onTriggered: {
            console.log("wmy qml...................: " + MainModel.musicTitle)
            if(flag)
               testText.text = MainModel.musicTitle
            else
               testText.text = MainModel.musicTitle + " "
            flag = !flag;
        }
    }

    TextView20 {
        id: testText
        anchors.horizontalCenter:parent.horizontalCenter
        y: 200
        width: 200
        //height: 42
        color: "salmon"
        text: MainModel.musicTitle
        scale: 1.2
        //font.pixelSize: 30
        //font: {Qt.font({pixelSize: 30 , unicodeCoverage: [Font.UnicodeBlock_CJKUnifiedIdeographs, Font.UnicodeBlock_BasicLatin]})}
        //font.unicodeCoverage: [Font.UnicodeBlock_CJKUnifiedIdeographs, Font.UnicodeBlock_BasicLatin]
    }

//    function getMusicTitle(): string{
//        var value = flag ? MainModel.musicTitle : MainModel.musicTitle + " "
//        flag = !flag
//        return  value
//    }

    TextView20 {
        anchors.horizontalCenter:parent.horizontalCenter
        y: 300
        width: 200
        //height: 42
        color: "salmon"
        text: MainModel.musicArtist
        //font.pixelSize: 30
        //font: {Qt.font({pixelSize: 30 , unicodeCoverage: [Font.UnicodeBlock_CJKUnifiedIdeographs, Font.UnicodeBlock_BasicLatin]})}
        //font.unicodeCoverage: [Font.UnicodeBlock_CJKUnifiedIdeographs, Font.UnicodeBlock_BasicLatin]
    }


//    Shape {
//            width: 200
//            height: 150
//            anchors.centerIn: parent
//            ShapePath {
//                strokeWidth: 4
//                strokeColor: "green"

//                startX: 20; startY: 20
//                PathLine { x: 180; y: 130 }
//                PathLine { x: 20; y: 130 }
//                PathLine { x: 20; y: 20 }
//            }
//        }
}
