Results 1 to 5 of 5

Thread: Serialization

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Serialization

    I told you to pay attention to the detailed description..
    Each item written to the stream is written in a predefined binary format that varies depending on the item's type. Supported Qt types include QBrush, QColor, QDateTime, QFont, QPixmap, QString, QVariant and many others. For the complete list of all Qt types supporting data streaming see the Format of the QDataStream operators.
    You can write QDataStream operators for your class:
    Qt Code:
    1. QDataStream& operator << (QDataStream& stream, const SomeClass& some)
    2. {
    3. stream << ...
    4. return stream;
    5. }
    6.  
    7. QDataStream& operator >> (QDataStream& stream, SomeClass& some)
    8. {
    9. ...
    10. stream >> ..
    11. return stream;
    12. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. The following 2 users say thank you to jpn for this useful post:

    Carlton (22nd February 2009), donmorr (17th November 2006)

Similar Threads

  1. [Qt4] qdatastream/qstring serialization
    By fabo in forum Qt Programming
    Replies: 4
    Last Post: 19th April 2006, 19:31

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.