Pixie Pixie - 6 months ago 33
Python Question

PyQt5 + Python 3.5.1: QProgressBar seems to not be able to connect to signals

Here is my code.

Here is the error it's spitting out.

I have absolutely no idea what is going on. To my extensive searching, this seems to be correctly wired up, but for some apparent reason, PyQt5 is being sassy.

Answer

You're using bar.connect(timer, SIGNAL("timeout()"), bar, SLOT("increaseValue()")) which is the old signal-slot syntax from PyQt4.

You should instead use timer.timeout.connect(bar.increaseValue) as per the PyQt5 documentation.

Comments