<br><br>I've trying to understand how to make a cmd button call a method when the button is pressed.<br><br>I havne't been seen an example in the Signals & Slots section of the QT docs which describe how to connect a widget signal to a callback function, only how to call a widget slot function.
<br>I don't get any runtime errors in my attempt to do this, but the callback function isn't being called.<br><br>What is the preferred method of registering a non-widget slot to be called by a widget signal?<br><br>
<br>class Dialog(QtGui.QDialog):<br> <br> def __init__(self, parent=None):<br> QtGui.QDialog.__init__(self, parent)<br> self.patchBrowser = QtGui.QTextEdit() <br> # layout code omitted for brevity
<br><br> def updateTextBox(self): # this function shoul dbe called, when the button is pressed<br> self.patchBrowser.setPlainText(self.tr("Callback was called"))<br> <br> def createPatchnameComboBox(self):
<br> self.patchNames = QtGui.QComboBox()<br> self.patchNames.addItem("Entry 1")<br> self.patchNames.addItem("Entry 2")<br><br> # layout code omitted for brevity<br>
<br> #self.connect(self.patchNames, QtCore.SIGNAL("higlighted"), self, QtCore.SLOT("updateTextBox") ) # doesn't call updateTextBox<br> self.connect(self.patchNames, QtCore.SIGNAL("activated"), self,
QtCore.SLOT("updateTextBox") )<br><br><br>