|
@@ -1,5 +1,6 @@
|
|
|
import QtQuick 2.12
|
|
|
import QtQuick.Controls 2.12
|
|
|
+import QtQuick.Controls 1.4
|
|
|
|
|
|
Item {
|
|
|
id:root
|
|
@@ -13,6 +14,7 @@ Item {
|
|
|
property string text_state1:"合格"
|
|
|
property string text_state2:"不合格"
|
|
|
property string text_state3:"无此项"
|
|
|
+
|
|
|
signal usateChanged
|
|
|
|
|
|
state: "0"
|
|
@@ -42,8 +44,10 @@ Item {
|
|
|
ButtonGroup{
|
|
|
id:group
|
|
|
buttons: row.children
|
|
|
+
|
|
|
+ /*
|
|
|
onClicked:{
|
|
|
- //console.log("tristate clicked:", button.text)
|
|
|
+ console.log("tristate clicked:", button.text)
|
|
|
var old_state = state
|
|
|
|
|
|
if(text_state1 === button.text){
|
|
@@ -54,20 +58,36 @@ Item {
|
|
|
state = "2"
|
|
|
}
|
|
|
|
|
|
+ console.log("tristate old_state:", old_state)
|
|
|
+ console.log("tristate state:", state)
|
|
|
+
|
|
|
if(old_state !== state){
|
|
|
//value = value_tmp
|
|
|
root.usateChanged()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ */
|
|
|
+
|
|
|
}
|
|
|
|
|
|
Row{
|
|
|
id: row
|
|
|
+
|
|
|
+
|
|
|
UserRadioButton{
|
|
|
id:rb1
|
|
|
checked: true
|
|
|
text: text_state1
|
|
|
font.pixelSize: fontsize
|
|
|
+ onCheckedChanged: {
|
|
|
+
|
|
|
+ if("0" !== root.state){
|
|
|
+ //console.log("rb1 onCheckedChanged, rootstate:" , root.state)
|
|
|
+ root.state = "0"
|
|
|
+ root.usateChanged()
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -76,6 +96,14 @@ Item {
|
|
|
checked: false
|
|
|
text: text_state2
|
|
|
font.pixelSize: fontsize
|
|
|
+ onCheckedChanged: {
|
|
|
+ if("1" !== root.state){
|
|
|
+ //console.log("rb2 onCheckedChanged, rootstate:" , root.state)
|
|
|
+ root.state = "1"
|
|
|
+ root.usateChanged()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
UserRadioButton{
|
|
@@ -83,6 +111,15 @@ Item {
|
|
|
checked: false
|
|
|
text: text_state3
|
|
|
font.pixelSize: fontsize
|
|
|
+
|
|
|
+ onCheckedChanged: {
|
|
|
+ if("2" !== root.state){
|
|
|
+ //console.log("rb3 onCheckedChanged, rootstate:" , root.state)
|
|
|
+ root.state = "2"
|
|
|
+ root.usateChanged()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|