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. Storing real time datas as a JSON File
Forum Updated to NodeBB v4.3 + New Features

Storing real time datas as a JSON File

Scheduled Pinned Locked Moved Unsolved General and Desktop
jsonreal timeqt5
6 Posts 3 Posters 723 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.
  • D Offline
    D Offline
    deleted286
    wrote on last edited by
    #1

    Hi everyone. I have a QMAP. I'm drawing a route on the map. I want to save my drawn routes in a JSON file.
    I know we can read json and write json files in qt. But my goal is doing it in real time. When i draw the route, it should save the coordinates as a json file.
    Is it possible to store some datas synchronously ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      QJson API does not support such use case.

      What you can do, however, is to (for example) periodically "dump" your route data to a file, updating it if it already exists. Or you can use some other JSON library which supports stream reading and writing. Or use stream writers for XML or CBOR (if switching to a different format is OK for you).

      (Z(:^

      D 1 Reply Last reply
      3
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Periodic data with same structure -> database :)

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        D 1 Reply Last reply
        3
        • sierdzioS sierdzio

          QJson API does not support such use case.

          What you can do, however, is to (for example) periodically "dump" your route data to a file, updating it if it already exists. Or you can use some other JSON library which supports stream reading and writing. Or use stream writers for XML or CBOR (if switching to a different format is OK for you).

          D Offline
          D Offline
          deleted286
          wrote on last edited by
          #4

          @sierdzio Thank you

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            Periodic data with same structure -> database :)

            D Offline
            D Offline
            deleted286
            wrote on last edited by
            #5

            @Christian-Ehrlicher I want to do it in a format that is both human-readable and machine-readable

            Christian EhrlicherC 1 Reply Last reply
            0
            • D deleted286

              @Christian-Ehrlicher I want to do it in a format that is both human-readable and machine-readable

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @suslucoder This is contrary to 'real-time'.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0

              • Login

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