Controls 2 - SpinBox problems
-
I'm trying to build an application that involves quite a few spinboxes, I'm using controls v2.
Things I'd like to see, but can't seem to find:- "onIncrement" and "onDecrement" signals. Am I missing something here?
- the "decimals" property of v1 spinboxes. Why has that been removed?
I've ended up solving both, but the solutions are far from elegant or obvious, and it seems like these are two things that should be in the API in the first place.
Is there something I'm missing here?Thanks
-
how about using the onValueChanged().. signal. This should help you.
-
I'm trying to build an application that involves quite a few spinboxes, I'm using controls v2.
Things I'd like to see, but can't seem to find:- "onIncrement" and "onDecrement" signals. Am I missing something here?
- the "decimals" property of v1 spinboxes. Why has that been removed?
I've ended up solving both, but the solutions are far from elegant or obvious, and it seems like these are two things that should be in the API in the first place.
Is there something I'm missing here?Thanks
mmh, seems easy enough to implement yourself:
SpinBox{ property int lastValue: 0 signal increment() signal decrement() onValueChanged: { if(value - lastValue === 1)//With this increment/decrement is only invoked with the value changes by exactly 1 increment() if(value - lastValue === -1) decrement() lastValue = value; } }
-
mmh, seems easy enough to implement yourself:
SpinBox{ property int lastValue: 0 signal increment() signal decrement() onValueChanged: { if(value - lastValue === 1)//With this increment/decrement is only invoked with the value changes by exactly 1 increment() if(value - lastValue === -1) decrement() lastValue = value; } }