Skip to content

Commit 0aa06b5

Browse files
Update calculator.py
Update calculator.py
1 parent 23b6d3d commit 0aa06b5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Calculator/calculator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from PyQt5.uic import loadUi
88
import sys
99
width = 401
10-
height = 398
11-
class Window(QWidget):
10+
height = 407
11+
class Window(QMainWindow):
1212
result = 0
1313
def __init__(self):
1414
super(Window,self).__init__()
@@ -36,7 +36,7 @@ def __init__(self):
3636

3737
self._result.clicked.connect(self.result)
3838
self.clear.clicked.connect(self.clear_text)
39-
39+
self.create_statusbar()
4040
def result(self):
4141
text = self.line.text()
4242
print(text)
@@ -113,7 +113,11 @@ def error_message(self):
113113
mess.setDetailedText("Calculator Error")
114114
mess.setStandardButtons(QMessageBox.Ok)
115115
res = mess.exec_()
116-
116+
117+
def create_statusbar(self):
118+
status = QStatusBar()
119+
status.showMessage("Calculator v1.0")
120+
self.setStatusBar(status)
117121
def main():
118122
app = QApplication(sys.argv)
119123
app.setApplicationName("ماشین حساب")
@@ -125,6 +129,5 @@ def main():
125129
sys.exit(app.exec_())
126130

127131
if __name__ == "__main__":
128-
# Calculator v1.0
129132
main()
130133

0 commit comments

Comments
 (0)