[PySide] PySide calls wrong emit() inside class

Robert Schilling Fun_Extra_300 at gmx.net
Tue Jul 23 18:08:55 CEST 2013


Hi @ all,

Consider following example:

from PySide import QtCore
from PySide.QtCore import QObject

class Foo(QObject):

    sig = QtCore.Signal(str)

    def __init__(self):
        QObject.__init__(self)

    def emit(self):
        self.sig.emit("1")
 
x = Foo()
x.emit()

This example doesn't work. When calling self.sig.emit("1") actually Foo.emit() is invoked. 
Testing this example works with PyQt (that's what I'm migrating from).

Am I doing something wrong? How can I avoid this?

Regards Robert



More information about the PySide mailing list