跪求,為什麼我這個登入事件無法執行??點選登入沒有反應??跪求
阿新 • • 發佈:2018-12-09
# -*- coding: utf-8 -*- from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import* from traprotionApp import Ui_traspationApp from LoginWindow import * from mian import * class MainWindow(QtWidgets.QMainWindow, Ui_traspationApp): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setupUi(self) self.setWindowTitle('網際網路收費資料軸載分析平臺') self.setWindowIcon(QIcon("icon.jpg")) def closeEvent(self, event): reply =QMessageBox.question(self,'提示',"您確定退出嗎?",QMessageBox.Yes|QMessageBox.No,QMessageBox.No) if reply == QMessageBox.Yes: event.accept() else : event.ignore() class loginWindow(QtWidgets.QMainWindow,Ui_Form): def __init__(self, parent=None): super(loginWindow, self).__init__() self.setupUi(self) # 定義登入按鈕的功能 self.loginpushButton.clicked.connect(self.loginEvent) self.forgetpushButton.clicked.connect(self.cancleClicked) def loginEvent(self): if self.accontlineEdit.text().strip()=="ruichigongsi" and self.passwordlineEdit.text().strip()=="111": ww = MainWindow() windows = Ui_traspationApp() windows.setupUi(ww) ww.show() app.exit() else : QMessageBox.warning(self,"warning","User name or password error ",QMessageBox.Yes) self.accontlineEdit.clear() self.passwordlineEdit.clear() self.accontlineEdit.setFocus() def cancleClicked(self): QMessageBox.warning(self,"warning","you are going to edit",QMessageBox.Yes)