Do you need the effect of changing a drop-down list to call a function?
Connect the drop-down list of the corresponding signal to your function.
For example, using QComboBox currentIndexChanged (). Connect this to the wrapper function, which decides (based on the index) which function to call.
Edit: a wrapper can be very simple, for example:
functions = {0: reference_to_function_1, 1: reference_to_function_2} def wrapper(index): functions[index]()
Edit2: If you want to use alternative methods for connecting slots:
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#connecting-signals-and-slots
Notice when they talk about Py or Qt signals, and when they talk about Python functions or methods. For example, this is the syntax for connecting a Qt signal to a Python function and Python method:
QtCore.QObject.connect(a, QtCore.SIGNAL("QtSig()"), pyFunction) #function-style QtCore.QObject.connect(a, QtCore.SIGNAL("QtSig()"), pyClass.pyMethod) #method-style
source share