不确定如何在 QML 的中继器循环中增加“某些东西”:变量、属性。
我宁愿不必将包装器加入到 cpp 函数中。
property int bs: 0
Repeater {
model: 12
bs: {
var vbs = bs + 1; //this works
vbs;
}//ERROR: Cannot assign to non-existent property bs
}
Repeater{
model: 7
Row {
spacing: table.rowSpacing
DiagValue{
value: {trans("sw " + (index + 1))}
width: 60
}
Repeater{
model: 12
CheckBox {
id:myCheckbox
width: 50
height: 50
backingVisible: false
checkable: true
onClicked:{
matrix[i_index? ][j_index? ] = myCheckbox.checked //how to do this assignement??
//pass the matrix to a cpp wrapper.
}
OR
onClicked:{
matrix[i] = myCheckbox.checked //how to do this assignement??
i++;//??
//pass the matrix to a cpp wrapper.
}
}
}
}