-
Notifications
You must be signed in to change notification settings - Fork 2
/
sample.py
41 lines (31 loc) · 1014 Bytes
/
sample.py
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
31
32
33
34
35
36
37
38
39
40
41
from PyQt5.QtWidgets import *
from PyQt5 import uic
class MyGUI(QMainWindow):
def __init__(self):
super(MyGUI, self).__init__()
uic.loadUi("mygui.ui", self)
self.show()
self.pushButton.clicked.connect(self.login)
self.pushButton_2.clicked.connect(lambda: self.sayit(self.textEdit.toPlainText()))
self.actionClose.triggered.connect(exit)
def login(self):
self.convert(12)
if self.lineEdit.text() == "nakooya" and self.lineEdit_2.text() == "password":
self.textEdit.setEnabled(True)
self.pushButton_2.setEnabled(True)
else:
message = QMessageBox()
message.setText("Invalid Login")
message.exec_()
def convert(self, int):
print (int)
def sayit(self, msg):
message = QMessageBox()
message.setText(msg)
message.exec_()
def main():
app = QApplication([])
window = MyGUI()
app.exec_()
if __name__ == '__main__':
main()