QML-RadioButton

RadioButton {
    id:root2
    checked: false
    property color checkedColor: "#E5F012"
    property int node_id: 2;
    onClicked: {
        if(root2.checked)
        {
            swipeView.currentIndex = 1;
        }
    }
    contentItem:Text {
        text: "网络交换机"
        font.pixelSize: 15;
        opacity: enabled ? 1.0 : 0.3
        color: "white";
        verticalAlignment: Text.AlignVCenter
        anchors.left: parent.left;
        anchors.leftMargin: 27;
        anchors.verticalCenter: parent.verticalCenter;
    }
    indicator: Rectangle {
        anchors.left: parent.left;
        anchors.verticalCenter: parent.verticalCenter
        width: 20; height: width
        antialiasing: true
        radius: width/2
        border.width: 2
        border.color: selectCol.bkcolor;
        Rectangle {
            anchors.centerIn: parent
            width: parent.width*0.7; height: width
            antialiasing: true
            radius: width/2
            color: selectCol.checkedColor
            visible: root2.checked
        }
    }
}

 

posted @ 2020-08-07 10:52  朱小勇  阅读(558)  评论(0编辑  收藏  举报