I am writing a program with python 3.3.3 and pyqt5. I have connected many signals and slots with no problem. This one is causing a problem. My code follows:
The error is caused by attempting to connect to the result of a function call (which in this case is None
), instead of the function object itself. Of course, this also explains why the function is executed immedaitely.
You should wrap the function call in a lambda
, like this:
vendorComboBox.currentTextChanged.connect(
lambda: _vendorChanged(vendorComboBox, dictVendors, modelComboBox))