SoduPopGames

Login Code |||Python|||

Sep 22nd, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3.  
  4.  
  5. import sys
  6. from PyQt5.QtWidgets import QWidget, QMessageBox, QApplication,QLabel,QLineEdit
  7.  
  8.  
  9. class Login(QWidget):
  10.    
  11.     def __init__(self):
  12.         super().__init__()
  13.        
  14.         self.IniciarV()
  15.        
  16.        
  17.     def IniciarV(self):            
  18.                
  19.         lbl_usuario = QLabel ("Usuario",self)
  20.         lbl_usuario.move(30,20)
  21.         lbl_usuario.show()
  22.        
  23.         lbl_password = QLabel ("Pasword",self)
  24.         lbl_password.move(30,60)
  25.         lbl_password.show()
  26.        
  27.         txt_usuario = QLineEdit()
  28.         txt_usuario.move(142,10)
  29.         txt_usuario.show()
  30.  
  31.         txt_password = QLineEdit()
  32.         txt_password.move(142,50)
  33.         txt_password.show()
  34.  
  35.         self.setGeometry(300, 300, 346, 196)        
  36.         self.setWindowTitle('Login - Sistema de Ventas')    
  37.         self.show()
  38.  
  39.  
  40.  
  41.        
  42.  
  43.     def closeEvent(self, event):
  44.        
  45.         mensaje_salir = QMessageBox.question(self, 'Mensaje',
  46.             "Estas seguro de salir? ", QMessageBox.Yes |
  47.             QMessageBox.No, QMessageBox.No)
  48.  
  49.         if mensaje_salir == QMessageBox.Yes:
  50.             event.accept()
  51.         else:
  52.             event.ignore()        
  53.        
  54.        
  55. if __name__ == '__main__':
  56.    
  57.     app = QApplication(sys.argv)
  58.     ventana_login = Login()
  59.     sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment