Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

PyQt5 Assign multiple functions to a button



  • Hey, i want to assign multiple functions to a button but the second function doesnt execute when i click the button. It works when i only connect the second function to the button. That's the code snipped:

    ui.button_start.clicked.connect(lambda: bot.accept_request(loop=True))
    ui.button_start.clicked.connect(lambda: ui.button_start.setText("Stop"))
    

    i already searched on the internet and they say that it should work, but it doesn't :(

    I'm happy about every answer! :)



  • @kolle said in PyQt5 Assign multiple functions to a button:

    lambda: bot.accept_request(loop=True)

    What does this do? If it is a loop that blocks your EventLoop, the second signal can't get through.


Log in to reply