[Qt-interest] Storing Qt properties to file

Schimkowitsch Robert Robert.Schimkowitsch at andritz.com
Mon Sep 26 11:23:28 CEST 2011


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
#####################################################################################

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110926/e9a24e57/attachment.html 


More information about the Qt-interest-old mailing list