Results 1 to 2 of 2

Thread: QSettings custom class serialization problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 127 Times in 121 Posts

    Default Re: QSettings custom class serialization problem

    Quote Originally Posted by sakya View Post
    Is it normal?
    Yes.

    Quote Originally Posted by sakya View Post
    How can I correctly serialize that Test2 instance?
    In this case, it would be fairly easy to tweak the code to serialize properly but a lot more annoying to deserialize. Basically you'd have to move the serialization code to a virtual method of Test and the deserialization to some kind of factory. To distinguish between serialization of different types you'd then need to prefix the serialized data with a id (unique to each supported class).
    Current Qt projects : QCodeEdit, RotiDeCode

  2. The following user says thank you to fullmetalcoder for this useful post:

    sakya (19th December 2011)

Similar Threads

  1. Replies: 0
    Last Post: 10th December 2011, 11:17
  2. Replies: 7
    Last Post: 18th August 2011, 14:43
  3. Class serialization
    By matulik in forum Qt Programming
    Replies: 6
    Last Post: 13th December 2010, 12:17
  4. Replies: 6
    Last Post: 7th December 2010, 12:32
  5. Replies: 2
    Last Post: 12th May 2010, 13:32

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
  •  
Qt is a trademark of The Qt Company.