From 9f9ca9b2498c8494cbf8d693ed184e8a64acf1bc Mon Sep 17 00:00:00 2001 From: gavin <2861484755@qq.com> Date: Thu, 30 Mar 2017 17:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=94=E7=A4=BA=E8=A7=A6=E5=8F=91=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2017_3_30/calculator.py | 17 -- 2017_3_30/calculator.ui | 631 ---------------------------------------- calc.py | 58 +++- calc.ui | 8 +- 4 files changed, 57 insertions(+), 657 deletions(-) delete mode 100644 2017_3_30/calculator.py delete mode 100644 2017_3_30/calculator.ui diff --git a/2017_3_30/calculator.py b/2017_3_30/calculator.py deleted file mode 100644 index a2dfefa..0000000 --- a/2017_3_30/calculator.py +++ /dev/null @@ -1,17 +0,0 @@ -import sys -from PyQt5 import uic -from PyQt5.QtWidgets import QApplication,QMainWindow - - - -class Calc(QMainWindow): - def __init__(self): - QMainWindow.__init__(self) - uic.loadUi('calculator.ui',self) - - -if __name__ == '__main__': - app = QApplication(['calculator.py']) - calc = Calc() - calc.show() - app.exec_() \ No newline at end of file diff --git a/2017_3_30/calculator.ui b/2017_3_30/calculator.ui deleted file mode 100644 index 7df6de9..0000000 --- a/2017_3_30/calculator.ui +++ /dev/null @@ -1,631 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 334 - 314 - - - - - 10 - 0 - - - - - 800 - 800 - - - - MainWindow - - - - - - 50 - 170 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 1 - - - - 50 - 50 - - - - - - - 100 - 170 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - - 50 - 50 - - - - - 50 - 50 - - - - 2 - - - - 50 - 50 - - - - - - - 150 - 170 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 3 - - - - 50 - 50 - - - - - - - 50 - 120 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 4 - - - - 50 - 50 - - - - - - - 100 - 120 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 5 - - - - 50 - 50 - - - - - - - 150 - 120 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 6 - - - - 50 - 50 - - - - - - - 50 - 70 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 7 - - - - 50 - 50 - - - - - - - 100 - 70 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 8 - - - - 50 - 50 - - - - - - - 150 - 70 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - 9 - - - - 50 - 50 - - - - - - - 50 - 220 - 91 - 41 - - - - - 10 - 10 - - - - - 800 - 800 - - - - 0 - - - - 50 - 50 - - - - - - - 150 - 220 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - . - - - - 50 - 50 - - - - - - - 200 - 220 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - + - - - - 50 - 50 - - - - - - - 200 - 170 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - - - - - - 50 - 50 - - - - - - - 200 - 120 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - * - - - - 50 - 50 - - - - - - - 200 - 70 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - / - - - - 50 - 50 - - - - - - - 250 - 170 - 41 - 91 - - - - - 10 - 10 - - - - - 100 - 100 - - - - = - - - - 50 - 50 - - - - - - - 250 - 120 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - % - - - - 50 - 50 - - - - - - - 250 - 70 - 41 - 41 - - - - - 10 - 10 - - - - - 50 - 50 - - - - C - - - - 50 - 50 - - - - - - - 50 - 20 - 241 - 51 - - - - - - - - 0 - 0 - 334 - 23 - - - - - - - 800 - 800 - - - - - - - diff --git a/calc.py b/calc.py index b9ecbd5..aa11120 100644 --- a/calc.py +++ b/calc.py @@ -1,3 +1,4 @@ +#coding:utf-8 import sys from PyQt5 import uic from PyQt5.QtWidgets import QApplication @@ -7,13 +8,60 @@ class Calc(QMainWindow): def __init__(self): QMainWindow.__init__(self) uic.loadUi('calc.ui',self) - - - - + self.pushButton0.clicked.connect(self.a) + self.pushButton1.clicked.connect(self.b) + self.pushButton2.clicked.connect(self.c) + self.pushButton3.clicked.connect(self.d) + self.pushButton4.clicked.connect(self.e) + self.pushButton5.clicked.connect(self.f) + self.pushButton6.clicked.connect(self.g) + self.pushButton7.clicked.connect(self.h) + self.pushButton8.clicked.connect(self.k) + self.pushButton9.clicked.connect(self.m) + self.pushButton_clear.clicked.connect(self.calc_clear) + self.pushButton_add.clicked.connect(self.calc_add) + self.pushButton_sub.clicked.connect(self.calc_sub) + self.pushButton_div.clicked.connect(self.calc_div) + self.pushButton_mul.clicked.connect(self.calc_mul) + self.pushButton_dot.clicked.connect(self.calc_dot) + self.pushButton_equal.clicked.connect(self.calc_equal) + + def a(self): + print '我被点击了0' + def b(self): + print '我被点击了1' + def c(self): + print '我被点击了2' + def d(self): + print '我被点击了3' + def e(self): + print '我被点击了4' + def f(self): + print '我被点击了5' + def g(self): + print '我被点击了6' + def h(self): + print '我被点击了7' + def k(self): + print '我被点击了8' + def m(self): + print '我被点击了9' + def calc_add(self): + print '我被点击了add====' + def calc_sub(self): + print '我被点击了sub====' + def calc_div(self): + print '我被点击了div===' + def calc_mul(self): + print '我被点击了mul===' + def calc_equal(self): + print '我被点击了equal===' + def calc_dot(self): + print '我被点击了dot===' + def calc_clear(self): + print '我被点击了clear===' if __name__ == '__main__': app = QApplication(sys.argv) - print help(QApplication) calc = Calc() calc.show() app.exec_() diff --git a/calc.ui b/calc.ui index 5b653a6..69d1b64 100644 --- a/calc.ui +++ b/calc.ui @@ -232,7 +232,7 @@ . - + 150 @@ -252,7 +252,7 @@ + - + 150 @@ -272,7 +272,7 @@ - - + 150 @@ -292,7 +292,7 @@ * - + 150 -- Gitee