[PySide] PySide calls wrong emit() inside class
nathanjsmith at gmail.com
Tue Jul 23 18:31:28 CEST 2013
You've created your signal at the class level, so it is shared by all
instances of Foo. What you want is the signal at the object level, so each
instance holds its own signal. Do so by creating the signal in the __init__
self.sig = QtCore.signal(str)
On Jul 23, 2013 11:09 AM, "Robert Schilling" <Fun_Extra_300 at gmx.net> wrote:
> Hi @ all,
> Consider following example:
> from PySide import QtCore
> from PySide.QtCore import QObject
> class Foo(QObject):
> sig = QtCore.Signal(str)
> def __init__(self):
> def emit(self):
> x = Foo()
> 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
> PySide mailing list
> PySide at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PySide