1 Star 0 Fork 0

terance / pyqt_TEST

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main2.py 845 Bytes
一键复制 编辑 原始数据 按行查看 历史
terance 提交于 2019-01-30 10:34 . PYQTfirst
import sys
from PyQt5 import QtCore, QtGui, uic,QtWidgets
qtCreatorFile = "test1.ui" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class MyApp(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
QtWidgets.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.calc_tax_button.clicked.connect(self.CalculateTax)
def CalculateTax(self):
price = int(self.price_box.toPlainText())
tax = (self.tax_rate.value())
total_price = price + ((tax / 100) * price)
total_price_string = "含税价格是: " + str(total_price)
self.results_window.setText(total_price_string)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
window = MyApp()
window.show()
sys.exit(app.exec_())
1
https://gitee.com/terance/pyqt_TEST.git
git@gitee.com:terance/pyqt_TEST.git
terance
pyqt_TEST
pyqt_TEST
master

搜索帮助