I want to connect the "RPG" menu with the "clickMSG" function.
I don't get an error when I run the code, but the connect is colored in white, therefor is not assigned to anything. Here is the code:
class gui(QMainWindow):
def __init__(self, parent = None):
super(gui, self).__init__(parent)
layout = QHBoxLayout()
menu = self.menuBar()
file = menu.addMenu("New Account")
file.addAction("file")
file2 = menu.addMenu('RGP')
rpg = QAction("RGP")
file2.triggered[QAction].connect(self.clickMSG)
def clickMSG(self):
msg = QMessageBox()
msg.setText("This is your RGP")
msg.setWindowTitle("This is an RGP")
msg.setIcon(QMessageBox.Information)
pwo = PasswordGenerator()
passwrd = pwo.shuffle_password(string.ascii_letters, 10)
def main():
app = QApplication(sys.argv)
ex = gui()
ex.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()