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 } } }
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html