[PyQt] copy.deepcopy and PyQt?

Phil Thompson phil at riverbankcomputing.com
Thu Apr 30 17:35:51 BST 2009


On Thu, 30 Apr 2009 18:11:23 +0200, Lukas Hetzenecker <LuHe at gmx.at> wrote:
> Hello,
> 
> i noticed a problem when I tried the attatched script:
> If a object is derived from QObject and i make a deepcopy of this object,
> all 
> member variables get lost.
> If I derive from object it works perfectly.
> 
> Please look at the attatched example. It produces the following output:
> Hello World from MyObject!
> Hello World from MyQObject!
> Hello World from MyObject!
> Traceback (most recent call last):
>   File "test.py", line 31, in <module>
>     cq.print_()
>   File "test.py", line 10, in print_
>     print self.string
> AttributeError: string

Deep copying of QObjects isn't supported.

Phil


More information about the PyQt mailing list