元素.qml
Item{
property int step
property int minValue
property int maxValue
property int value //should accept values of form i*step+minValue
}
main.qml
Element{
step:2
minValue:-7
maxValue:7
value:0 //not an acceptable value(2*i-7), should convert to 1 or -1
}
如果我设置了值,它应该将值转换为最近step*i+minValue,即0到1然后发出valueChanged()。
我希望valueChanged()仅在其值为 时才发出信号step*i+minValue。