@@ -101,20 +101,21 @@ func (r *GoRect) Paint(p *qml.Painter) {
101
101
type GoType struct {
102
102
private bool // Besides being private, also adds a gap in the reflect field index.
103
103
104
- StringValue string
105
- BoolValue bool
106
- IntValue int
107
- Int64Value int64
108
- Int32Value int32
109
- Uint32Value uint32
110
- Float64Value float64
111
- Float32Value float32
112
- AnyValue interface {}
113
- ObjectValue qml.Object
114
- ColorValue color.RGBA
115
- IntsValue []int
116
- ObjectsValue []qml.Object
117
- MapValue map [string ]interface {}
104
+ StringValue string
105
+ StringAddrValue * string
106
+ BoolValue bool
107
+ IntValue int
108
+ Int64Value int64
109
+ Int32Value int32
110
+ Uint32Value uint32
111
+ Float64Value float64
112
+ Float32Value float32
113
+ AnyValue interface {}
114
+ ObjectValue qml.Object
115
+ ColorValue color.RGBA
116
+ IntsValue []int
117
+ ObjectsValue []qml.Object
118
+ MapValue map [string ]interface {}
118
119
119
120
SetterStringValue string
120
121
SetterObjectsValue []qml.Object
@@ -715,16 +716,20 @@ var tests = []struct {
715
716
GoType {
716
717
stringValue: "<old>"
717
718
onStringValueChanged: console.log("String is", stringValue)
719
+ onStringAddrValueChanged: console.log("String at addr is", stringAddrValue)
718
720
}
719
721
` ,
720
722
QMLLog : "!String is" ,
721
723
Done : func (c * TestData ) {
722
724
c .Assert (c .createdValue , HasLen , 1 )
723
725
value := c .createdValue [0 ]
726
+ s := "<new at addr>"
724
727
value .StringValue = "<new>"
728
+ value .StringAddrValue = & s
725
729
qml .Changed (value , & value .StringValue )
730
+ qml .Changed (value , & value .StringAddrValue )
726
731
},
727
- DoneLog : "String is <new>" ,
732
+ DoneLog : "String is <new>.*String at addr is <new at addr> " ,
728
733
},
729
734
{
730
735
Summary : "qml.Changed must not trigger on the wrong field" ,
@@ -1216,6 +1221,7 @@ func (s *S) TestTable(c *C) {
1216
1221
1217
1222
if ! reflect .DeepEqual (t .QMLValue , GoType {}) {
1218
1223
c .Check (value .StringValue , Equals , t .QMLValue .StringValue )
1224
+ c .Check (value .StringAddrValue , Equals , t .QMLValue .StringAddrValue )
1219
1225
c .Check (value .BoolValue , Equals , t .QMLValue .BoolValue )
1220
1226
c .Check (value .IntValue , Equals , t .QMLValue .IntValue )
1221
1227
c .Check (value .Int64Value , Equals , t .QMLValue .Int64Value )
@@ -1245,6 +1251,7 @@ func (s *S) TestTable(c *C) {
1245
1251
1246
1252
if ! reflect .DeepEqual (t .DoneValue , GoType {}) {
1247
1253
c .Check (value .StringValue , Equals , t .DoneValue .StringValue )
1254
+ c .Check (value .StringAddrValue , Equals , t .DoneValue .StringAddrValue )
1248
1255
c .Check (value .BoolValue , Equals , t .DoneValue .BoolValue )
1249
1256
c .Check (value .IntValue , Equals , t .DoneValue .IntValue )
1250
1257
c .Check (value .Int64Value , Equals , t .DoneValue .Int64Value )
0 commit comments