From pykde Wed Apr 06 17:08:19 2005 From: James Emerton Date: Wed, 06 Apr 2005 17:08:19 +0000 To: pykde Subject: Re: [PyKDE] Using QDataStream Message-Id: <3f2a7829644d869d0e95bb74f760f852 () emdata ! net> X-MARC-Message: https://marc.info/?l=pykde&m=111280738816984 You may be able to exploit the Qt properties system to retrieve the most interesting members. (Provided that the parts interesting to you are actually properties.) # Saving... props = { } for p in obj.metaClass().propertyNames( True ): props[ p ] = obj.property( p ) # Loading... for p, v in props.iteritems(): obj.setProperty( p, v ) Of course, this is all of the top of my head and before my coffee has had a chance to kick in. James On 5-Apr-05, at 5:39 PM, Eron Lloyd wrote: > Hello again, > > Since pickle doesn't allow objects wrapping QObjects, I guess > QDataStream is > the next best bet. I haven't found any good examples of it in action, > so was > wondering if anyone has any suggestions. Basically I have a class that > acts > as a data model, and I'd like to store it's members (both python and > QObjects) as serialized files. I've been spoiled by pickle up 'til > now... > > Thanks, > > Eron > > _______________________________________________ > PyKDE mailing list PyKDE@mats.imk.fraunhofer.de > http://mats.imk.fraunhofer.de/mailman/listinfo/pykde > -- This is not my home; the cats just let me stay here. _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde