disconnect

PyQt Widget connect() and disconnect()

PyQt Widget connect() and disconnect() Question: Depending on a conditions I would like to connect/re-connect a button to a different function. Let’s say I have a button: myButton = QtGui.QPushButton() For this example let’s say I check if there is an internet connection. if connected == True: myButton.clicked.connect(function_A) elif connected == False: myButton.clicked.connect(function_B) First of …

Total answers: 3