Searching in a network to manipulate windows, from a main window, I will be able to do it, what I do not find yet, is already running the program, in the login to put both user and password as admin, I should leave a QMessageBox , with any message ("welcome"). I run everything when instead of putting the QMessageBox, I call another window PD: the other function calls work for me, I have tried them without the QMessageBox and it runs normally, I have Python 3.7.1
import sys from PyQt5 import *
class login (QMainWindow):
def __init__(self):
super(login, self).__init__()
loadUi('login.ui', self)
rutaDeImagen = "C:/Users/AlvaroMartin/Desktop/rostro.jpg"
self.loginTLfoto.setPixmap(QtGui.QPixmap(rutaDeImagen))
self.loginJBIngresar.clicked.connect(self.buttonClicked)
def buttonClicked(self, e):
if(self.loginTFusuario.text() == "admin" and self.loginTFcontra.text() == "admin"):
rutaDeImagenA = "C:/Users/AlvaroMartin/Desktop/admin.jpg"
self.loginTLfoto.setPixmap(QtGui.QPixmap(rutaDeImagenA))
#self.loginJBIngresar.clicked.connect(self.loginCheck)
self.loginCheck()
self.cambiosEnLogin()
#self.showMessageBox('Warning','Invalid Username And Password')
#self.abrirVentanaAdmin()
# se agregara la opcion de que cambie la foto del admin
else:
self.cambiosEnLogin()
self.abrirVentanaUsuario()
self.loginJBIngresar.clicked.connect(self.abrirVentanaUsuario)
def loginCheck(self):
print("UNA LINEA ANTES DEÑ MSSBOX ")
self.showMessageBox('Warning','Invalid Username And Password')
print("DESPUES DEL MSSBOX")
def showMessageBox(self,title,message):
msgBox = QtGui.QMessageBox()
msgBox.setIcon(QtGui.QMessageBox.Warning)
msgBox.setWindowTitle(title)
msgBox.setText(message)
msgBox.setStandardButtons(QtGui.QMessageBox.Ok)
msgBox.exec_()