I'm building widgets via a separate builder method and would like them all to get the same set of signals. So I tried
from PyQt4.QtGui import * from PyQt4.QtCore import * if __name__ == '__main__': import sys app = QApplication(sys.argv) widget = QLineEdit() widget.mysignal = pyqtSignal(object) widget.mysignal.connect(widget.textChanged) widget.show() sys.exit(app.exec_()) But I'm getting: AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute 'connect' So I suspect it may have something to do with pyqtSignal being a factory and that it may introspect the class in which it is usually called (to get it's name) but can't wrap my head around how to make it work in a builder, or to simply assign a signal to an object outside of it's constructor. Anyone encountered this? How would you rather solve this issue? Ultimately, I'm looking to avoid typing the 4-5 separate signals that I'd like all of my similar widgets to inherit. Is multiple inheritance a better way? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAuoev5qiHJn-h%3DeXQWbqAs%3DfZzjpVOFTT8SdbpCxyUCw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
