Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- # -*- coding: utf-8 -*-
- import sys
- from PyQt5.QtWidgets import QWidget, QMessageBox, QApplication,QLabel,QLineEdit
- class Login(QWidget):
- def __init__(self):
- super().__init__()
- self.IniciarV()
- def IniciarV(self):
- lbl_usuario = QLabel ("Usuario",self)
- lbl_usuario.move(30,20)
- lbl_usuario.show()
- lbl_password = QLabel ("Pasword",self)
- lbl_password.move(30,60)
- lbl_password.show()
- txt_usuario = QLineEdit()
- txt_usuario.move(142,10)
- txt_usuario.show()
- txt_password = QLineEdit()
- txt_password.move(142,50)
- txt_password.show()
- self.setGeometry(300, 300, 346, 196)
- self.setWindowTitle('Login - Sistema de Ventas')
- self.show()
- def closeEvent(self, event):
- mensaje_salir = QMessageBox.question(self, 'Mensaje',
- "Estas seguro de salir? ", QMessageBox.Yes |
- QMessageBox.No, QMessageBox.No)
- if mensaje_salir == QMessageBox.Yes:
- event.accept()
- else:
- event.ignore()
- if __name__ == '__main__':
- app = QApplication(sys.argv)
- ventana_login = Login()
- sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment