[PySide] Inheriting the QObject class

94 views
Skip to first unread message

Marcin Łyko

unread,
Oct 12, 2010, 12:24:13 PM10/12/10
to pys...@lists.openbossa.org
Hi,

I try to subclass the QObject class, but I encounter, IMHO, strange
problem - I can create only one instance of my QObject subclass. It
seems that it is not allowed to do anything in the QObject subclass
__init__() method until the QObject.__init__() is called.

I don't see any reason for this kind of limitation, from Python point of
view. Please correct me if I'm wrong.

I attached a simple Python script, which demonstrates the problem.

Best Regards,
Marcin

qobject_subclass.py

Renato Araujo Oliveira Filho

unread,
Oct 12, 2010, 2:07:18 PM10/12/10
to marci...@comarch.com, pys...@lists.openbossa.org
Hi Marcin,

This problem is related with the bug 378 in PySide bugzila[1], We
fixed this bug on git HEAD version and this will be part of the new
release.

[1]http://bugs.openbossa.org/show_bug.cgi?id=378

Thanks

> _______________________________________________
> PySide mailing list
> PyS...@lists.openbossa.org
> http://lists.openbossa.org/listinfo/pyside
>
>

--
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
Mobile: +55 (81) 8704-2144
_______________________________________________
PySide mailing list
PyS...@lists.openbossa.org
http://lists.openbossa.org/listinfo/pyside

Marcin Łyko

unread,
Oct 13, 2010, 3:08:58 AM10/13/10
to Renato Araujo Oliveira Filho, pys...@lists.openbossa.org
Hi,

Are you really sure that this issue is related to the bug? Because I ran
the script with PySide git HEAD version installed and I got the same
error:

$ python qobject_subclass.py
Traceback (most recent call last):
File "qobject_subclass.py", line 22, in <module>
obj2 = MyObject()
File "qobject_subclass.py", line 19, in __init__
MyBaseObject.__init__(self)
File "qobject_subclass.py", line 10, in __init__
self.mySignal.connect(self.mySlot)
AttributeError: type object 'MyObject' has no attribute 'a'

Regards,
Marcin

Reply all
Reply to author
Forward
0 new messages