Home > Mobile >  Using QGraphicsView finish things how to save for a file?
Using QGraphicsView finish things how to save for a file?

Time:10-03

Using software written after open this file also can continue editing

CodePudding user response:

refer to the original poster zhangxinyu99 response:
use software written after open this file also can continue to edit

You of the text, in the shape of the data, the written text or XML, and plus software identify suffix, such as office software of excel, doc and similar suffix
Of course you can also use compression code or compression library file compression,

CodePudding user response:

Available QDataStream serialize binary, as the upstairs said, of course, can be serialized as plain text, XML, and other serialization of c + + library, such as the boost and Google,

Serialization and deserialization of a place is: serialized file compatibility forward and backward compatible ability,

CodePudding user response:

refer to the second floor kuyucman response:
available QDataStream serialize binary, as the upstairs said, of course, can be serialized as plain text, XML, and other serialization of c + + library, such as the boost and Google,

Serialization and deserialization of a place is: serialized file compatibility forward and backward compatible ability,


If the file written in multiple classes to read when I how to identify which classes to read out and then the new out this class?

CodePudding user response:

Often, your own serialization format, you already know, so when the deserialization nature shall be carried out in accordance with the format of the original agreement,
Relevant usage in QDatestream document made it very clear,
If you really need to distinguish between different classes (such as inheritance system of different subclasses), you can first make a tag is used to distinguish different classes, such as the classname

CodePudding user response:

Saved as XML files

CodePudding user response:

reference zhangxinyu99 reply: 3/f
Quote: refer to the second floor kuyucman response:

Available QDataStream serialize binary, as the upstairs said, of course, can be serialized as plain text, XML, and other serialization of c + + library, such as the boost and Google,

Serialization and deserialization of a place is: serialized file compatibility forward and backward compatible ability,


If the file written in multiple classes to read when I how to identify which classes to read out and then the new out this class?

Number for each class, reading XML read this number first, then use the factory pattern in the code of new a different class,

CodePudding user response:

The class name or type, make a mark, serialization

CodePudding user response:

QGraphicsView just show to use, as for the preservation of the data can custom file format, just read and write data in accordance with the format
  •  Tags:  
  • Qt
  • Related