diff options
author | Topi Reinio <topi.reinio@digia.com> | 2014-09-24 14:37:46 +0200 |
---|---|---|
committer | Topi Reiniö <topi.reinio@digia.com> | 2014-09-30 12:37:28 +0200 |
commit | f83d12e0c27ad76d98d66a663140a09698b11d37 (patch) | |
tree | 6ce1e66cd651c8b325f5a6790ea036e7bbe62c47 /examples/quick/demos/calqlatr/calqlatr.qml | |
parent | fccf0e29120f64a8b9b2a15b33971a648ab190e7 (diff) |
Update the Calqltr demo visuals and engine logic
- Add logic for displaying the calculation result in the best
available precision, determined by the display width
- Display 'ERROR' when the result cannot be displayed
- Animate the number pad button colors to react to presses and
visually disable them when pressing the button has no effect
- Fix issues in calculator.js logic
- Update documentation accordingly
Task-number: QTBUG-41253
Change-Id: Ibed7b8218ea4cd074b8f9b90d9bb4e3ea6b25ba2
Reviewed-by: Johanna Äijälä <johanna.aijala@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Diffstat (limited to 'examples/quick/demos/calqlatr/calqlatr.qml')
-rw-r--r-- | examples/quick/demos/calqlatr/calqlatr.qml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml index 02c5b13399..8bda2c521e 100644 --- a/examples/quick/demos/calqlatr/calqlatr.qml +++ b/examples/quick/demos/calqlatr/calqlatr.qml @@ -53,13 +53,22 @@ Rectangle { onWidthChanged: controller.reload() onHeightChanged: controller.reload() - function operatorPressed(operator) { CalcEngine.operatorPressed(operator) } - function digitPressed(digit) { CalcEngine.digitPressed(digit) } + function operatorPressed(operator) { + CalcEngine.operatorPressed(operator) + numPad.buttonPressed() + } + function digitPressed(digit) { + CalcEngine.digitPressed(digit) + numPad.buttonPressed() + } + function isButtonDisabled(op) { + return CalcEngine.disabled(op) + } Item { id: pad width: 180 - NumberPad { y: 10; anchors.horizontalCenter: parent.horizontalCenter } + NumberPad { id: numPad; y: 10; anchors.horizontalCenter: parent.horizontalCenter } } AnimationController { |