[Qt-interest] Storing Qt properties to file

Dan White ygor at comcast.net
Mon Sep 26 13:41:04 CEST 2011


Have you looked at Qsettings ?

http://doc.qt.nokia.com/latest/qsettings.html#accessing-ini-and-plist-files-directly


“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

----- Schimkowitsch Robert <Robert.Schimkowitsch at andritz.com> wrote:
> Hi,
> 
> I want to be able to write the properties of my object to file in a
> locale-independent way, and be able to restore the object using that
> stored information later on.
> 
> Before I start reinventing the wheel, I'd like to know whether something
> like this already exists (I couldn't find it, but then again Qt has
> grown big).
> 
> My plan includes the following steps. If you happen to know existing
> classes or samples that cover those steps, please let me know!
> 
> 1) Read and write QVariant: Handling of basic data types (float is a bit
> tricky, unicode strings might be)
> 2) Write a reader and writer that writes all Q_PROPERTIES of an object
> to an XML file, and reads them again, restoring the object properties.
> By using propertyOffset() of QMetaObject, I should be able to filter out
> base class properties that should not be saved and restored.
> 3) Define the needed properties in my objects, and call the
> reader/writer
> 
> Kind regards
> 
> Robert Schimkowitsch
> 
> #####################################################################################
> This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
> Thank You.
>   ANDRITZ HYDRO GmbH
>   Rechtsform/ Legal form: Gesellschaft mit beschrankter Haftung / Corporation 
>   Firmensitz/ Registered seat: Wien 
>   Firmenbuchgericht/ Court of registry: Handelsgericht Wien 
>   Firmenbuchnummer/ Company registration: FN 61833 g
>   DVR: 0605077 
>   UID-Nr.: ATU14756806
> #####################################################################################
> 




More information about the Qt-interest-old mailing list