<div dir="ltr"><div><div>You can only have pyqtSignal() on classes that are derived from QObject.<br></div><br></div>def Class(QObject):<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 28, 2015 at 4:48 PM, Jason H <span dir="ltr"><<a href="mailto:jhihn@gmx.com" target="_blank">jhihn@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How can I make the connection in Other.run()? The two approaches I tried get the errors in the comments.<br>
<br>
Thanks<br>
<br>
class.py----<br>
class Class:<br>
        doneVis1 = pyqtSignal()<br>
        doneVis2 = pyqtSignal()<br>
<br>
other.py-----<br>
class Other:<br>
        def run(self):<br>
                self.script = __import__('class')<br>
                self.c = self.script.Class()<br>
                self.c.doneVis1.connect(self.doneVis1) #TypeError: instance cannot be converted to PyQt5.QtCore.QObject in this context<br>
                self.script.Class.doneVis2.connect(self.doneVis2) #AttributeError: 'PyQt5.QtCore.pyqtSignal' object has no attribute 'connect'<br>
                c.run()<br>
        def doneVis1(self):<br>
                pass<br>
        def doneVis2(self):<br>
                pass<br>
_______________________________________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></blockquote></div><br></div>