-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelement.py
More file actions
30 lines (21 loc) · 845 Bytes
/
element.py
File metadata and controls
30 lines (21 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
from PyQt5 import QtCore, QtGui, uic
qtCreatorFile = 'untitled.ui' #window File
Ui_MainWindow,QtBaseClass = uic.loadUiType(qtCreatorFile)
class App(QtGui.QMainWindow,Ui_MainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.btnSub.clicked.connect(self.CalculateTax)
def CalculateTax(self):
price = int(self.textPrice.toPlainText())
tax = float(self.dSBPer.value())
total_price = price - ((tax/100) * price)
total_price_string = u'Do you can\'t to what money?:' + str(total_price)
self.labelResult.setText(total_price_string)
if __name__ == '__main__':
app = QtGui.QGuiApplication(sys.argv)
window = App()
window.show()
sys.exit(app.exec_())