diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-11-25 10:44:20 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-11-25 10:46:20 -0300 |
commit | 745f31ab32639c9b26fae15e07f065b5fe455043 (patch) | |
tree | 6690afa4174f8a5e7f5c61eb090f53d908f59d60 /examples | |
parent | 3f7afac8e4792e80c5bd7e1c561bee4c6391978f (diff) |
Fixed calculator example.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/widgets/calculator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/calculator.py b/examples/widgets/calculator.py index e380813..0171c67 100755 --- a/examples/widgets/calculator.py +++ b/examples/widgets/calculator.py @@ -45,7 +45,7 @@ class Button(QtGui.QToolButton): class Calculator(QtGui.QDialog): NumDigitButtons = 10 - + def __init__(self, parent=None): super(Calculator, self).__init__(parent) @@ -67,7 +67,7 @@ class Calculator(QtGui.QDialog): self.display.setFont(font) self.digitButtons = [] - + for i in range(Calculator.NumDigitButtons): self.digitButtons.append(self.createButton(str(i), self.digitClicked)) @@ -160,7 +160,7 @@ class Calculator(QtGui.QDialog): return result = math.sqrt(operand) - elif clickedOperator == "x\262": + elif clickedOperator == u"x\262": result = math.pow(operand, 2.0) elif clickedOperator == "1/x": if operand == 0.0: |