1234567891011121314151617181920212223242526272829303132333435363738 |
- import QtQuick 2.12
- import QtQuick.Controls 2.12
- //自定义单选按钮
- RadioButton {
- id: control
- text: qsTr("UserRadioButton")
- checked: true
- indicator: Rectangle {
- implicitWidth: 18
- implicitHeight: 18
- x: control.leftPadding
- y: parent.height / 2 - height / 2
- radius: 9
- border.color: control.down ? "#17a81a" : "#0099cc"
- Rectangle {
- width: 12
- height: 12
- x: 3 // (56 - 34) / 2
- y: 3
- radius: 6
- color: control.down ? "#17a81a" : "#0099cc"
- visible: control.checked
- }
- }
- contentItem: Text {
- text: control.text
- font: control.font
- opacity: enabled ? 1.0 : 0.3
- //color: control.down ? "#17a81a" : "#21be2b"
- verticalAlignment: Text.AlignVCenter
- leftPadding: control.indicator.width + control.spacing
- }
- }
|