Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Serialization features in qt
Forum Updated to NodeBB v4.3 + New Features

Serialization features in qt

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 390 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    I am trying to make the contents to be saved into an xml file or to re-objectify the contents of the xml file.
    I checked various things and confirmed that there is a serialization function of C#.
    Does qt have such a feature? please reply

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      yes
      Qt can stream most of its own types directly - but this is in binary format via
      https://doc.qt.io/qt-5/qdatastream.html

      It cant save to XML but QDatastreams is both faster and more compact.

      I 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        yes
        Qt can stream most of its own types directly - but this is in binary format via
        https://doc.qt.io/qt-5/qdatastream.html

        It cant save to XML but QDatastreams is both faster and more compact.

        I Offline
        I Offline
        IknowQT
        wrote on last edited by
        #3

        @mrjj

        Do you have any example projects?

        JonBJ 1 Reply Last reply
        0
        • I IknowQT

          @mrjj

          Do you have any example projects?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @IknowQT
          Did you look at the sample code fragments on the documentation page? That's all there is to it.

          In addition to XML serialization, C#/.NET also has binary serializiation, through System.Runtime.Serialization.Formatters.Binary. That is what Qt's QDataStream is equivalent to. Alternatively, don't forget that Qt has support for JSON serialization.

          1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            In addition to my fellows:
            QXmlStreamReader and QXmlStreamWriter.

            One important thing: all tools suggested until now won't serialize your objects automagically for you.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved