Results 1 to 3 of 3

Thread: QGraphicScene to stream

  1. #1
    Join Date
    Jun 2008
    Location
    Kent, UK
    Posts
    5
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicScene to stream

    Hello,

    I have an application which has a QList of QGraphicsScene's, I would like to save the scenes to a file and restore them. Can anybody show some example code of how I would do that?

    Do I have to iterate through each item in the scene and send it to a QDataStream? or can I just do something like:

    QDataStream out;
    out << m_scenes;

    Regards
    Phil

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicScene to stream

    See http://doc.trolltech.com/4.4/datastreamformat.html for the complete list of all Qt types supporting data streaming.

    Then you have to write code to serialize GraphicsItem and scene data
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicScene to stream

    Quote Originally Posted by phannent View Post
    Hello,

    I have an application which has a QList of QGraphicsScene's, I would like to save the scenes to a file and restore them. Can anybody show some example code of how I would do that?
    Regards
    Phil


    try to build:
    http://www.qt-apps.org/content/show....?content=80234

    and read:
    http://fop-miniscribus.googlecode.co...cs_structure.h -> class SPics extended image format
    and

    http://fop-miniscribus.googlecode.co...oc_structure.h and class RichDoc to store a QTextDocument

    note from an to toBase64 i choise only why i save on unknow codec db format!

    i take from http://wiki.qtcentre.org/index.php?t..._types_with_Qt

Similar Threads

  1. Replies: 10
    Last Post: 9th June 2016, 17:02
  2. Video Stream, extending QIODevice
    By rextr in forum Qt Programming
    Replies: 3
    Last Post: 27th June 2008, 08:55
  3. QGraphicScene MousePressEvent
    By Spitz in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2007, 21:46
  4. Custom objects in a QGraphicScene
    By draand in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 11:31
  5. QFile stream to SDL_mixer
    By doitux in forum Qt Programming
    Replies: 9
    Last Post: 2nd June 2007, 14:56

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.