Results 1 to 2 of 2

Thread: XML Serialization of Qt Objects

  1. #1
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default XML Serialization of Qt Objects

    How do i serialize Qt objects in XML format? I tried using Boost library but it requires me to convert each of my data type to standard C++ datatype. In QDataStream i was able to serialize into binary format. Please let me know how to serialize a whole Qt Object into XML file.

  2. #2
    Join Date
    Apr 2008
    Posts
    45
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: XML Serialization of Qt Objects

    You're going to have to write it yourself, but it should follow the QDataStream class. And if you do, you could use it interchangeably.

    There is a problem you will need to tackle though XML is a structured, nested format. QDataStream is only bytes. Therefore when choosing your XML schema, you will be very limited. While not impossible, you'd probably be left with a rather rudimentary set of elements and attributes. You could always map to/from a higher level, but that would be more work.

Similar Threads

  1. Deleting objects in their event handler
    By drhex in forum Qt Programming
    Replies: 7
    Last Post: 6th May 2009, 17:08
  2. QWizard creating objects dynamically
    By afflictedd2 in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2009, 16:43
  3. objects modelling
    By mickey in forum General Discussion
    Replies: 1
    Last Post: 12th April 2008, 09:14
  4. Custom objects in a QGraphicScene
    By draand in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 12:31
  5. static objects in libraries
    By Rawk in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 20:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.