Переглянути джерело

上传文件至 'Day5 刘琪20200404222/PyQT登录/digitapp'

lq 1 рік тому
батько
коміт
d03ef4c7ac

+ 16 - 0
Day5 刘琪20200404222/PyQT登录/digitapp/DigitApp.py

@@ -0,0 +1,16 @@
+"""
+"""
+from PyQt5.QtWidgets import QApplication
+from .DigitForm import DigitForm
+import sys
+
+class DigitApp(QApplication):
+    """
+    """
+    def __init__(self):
+        """
+        """
+        super(DigitApp, self).__init__(sys.argv)
+        # 创建应用主窗体
+        self.dlg = DigitForm()
+        self.dlg.show()

+ 34 - 0
Day5 刘琪20200404222/PyQT登录/digitapp/DigitForm.py

@@ -0,0 +1,34 @@
+from PyQt5.QtWidgets import QDialog
+from PyQt5.QtGui import QImage, QPixmap
+import sys
+from .DigitUI1 import Ui_Digit
+
+import numpy as np
+
+class DigitForm(QDialog):
+    def __init__(self):
+        super(DigitForm, self).__init__()
+        # 加载UI(先设计好)
+        # 创建对象
+        self.ui = Ui_Digit()
+        # 使用setupUi绑定对话框(父窗体)
+        self.ui.setupUi(self)
+
+
+
+
+
+    def capture_image(self):
+        if (self.ui.lbl_user.toPlainText() == 'yh') & (self.ui.lbl_pwd.toPlainText() == '123') :
+            self.ui.lbl_result.setText('欢迎:' + self.ui.lbl_user.toPlainText())
+        else:
+            self.ui.lbl_result.setText('用户名或者密码错误')
+
+
+
+
+
+
+
+
+

BIN
Day5 刘琪20200404222/PyQT登录/digitapp/__init__.py