[Interest] QDataStream & pointers

Igor Mironchik igor.mironchik at gmail.com
Sun Sep 13 13:46:50 CEST 2015


Hi,

2015-09-13 14:39 GMT+03:00 Reinhardt Behm <rbehm at hushmail.com>:

> On Sunday 13 September 2015 14:31:07 Igor Mironchik wrote:
> > Hi,
> >
> > How to serialize/deserialize pointers to/from QDataStream correctly?
>
> Just don't do it.
>
> The main reason to serialize data is to store it in some file and later
> retrieve it, possibly with another program.
> Even when retrieving a pointer with the same program running as a new
> instance
> the value (address) of a pointer has no meaning, since that address will
> not
> be pointing to valid memory.
>

I need this serializtion only in one instance of the running application. I
will not deserialize pointer when application restarted and so on.

I realy need it to handle Drag&Drop in QListView...

But I want some protection that pointer is serialized in the same app. How
to be sure that pointer was serialized exactly in this app? Or I have to
serialize qApp for checking it?

Is it safe to cast pointer to/drom quint64? Will it work on all platforms?

>
> --
> Best Regards
>
> Reinhardt Behm
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150913/95a67f1a/attachment.html>


More information about the Interest mailing list