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. Save/Load JSON using QML
Forum Updated to NodeBB v4.3 + New Features

Save/Load JSON using QML

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 5.4k 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.
  • A Offline
    A Offline
    Anas A. Ismail
    wrote on last edited by Anas A. Ismail
    #1

    Is that possible to Save/Load JSON data with only QML ??

    Thanks

    p3c0P 1 Reply Last reply
    0
    • A Anas A. Ismail

      Is that possible to Save/Load JSON data with only QML ??

      Thanks

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Anas-A.-Ismail Yes but only from network as QML doesnot have direct access to local file system.

      157

      A 1 Reply Last reply
      1
      • p3c0P p3c0

        @Anas-A.-Ismail Yes but only from network as QML doesnot have direct access to local file system.

        A Offline
        A Offline
        Anas A. Ismail
        wrote on last edited by
        #3

        @p3c0 hmmm, may you pass me an example ?

        p3c0P 1 Reply Last reply
        0
        • A Offline
          A Offline
          Anas A. Ismail
          wrote on last edited by
          #4

          I found an example here and the point discussed in this thread also.
          kindly check them and let us know if you have any other thoughts.

          Thanks :)

          1 Reply Last reply
          0
          • A Anas A. Ismail

            @p3c0 hmmm, may you pass me an example ?

            p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by p3c0
            #5

            @Anas-A.-Ismail Any Javascript JSON example would work. For eg. Use the AJAX code from here and put it inside a function in QML.

            157

            A 1 Reply Last reply
            1
            • p3c0P p3c0

              @Anas-A.-Ismail Any Javascript JSON example would work. For eg. Use the AJAX code from here and put it inside a function in QML.

              A Offline
              A Offline
              Anas A. Ismail
              wrote on last edited by
              #6

              @p3c0 what the url should be if the files are on local file system ?

              p3c0P 1 Reply Last reply
              0
              • dheerendraD Offline
                dheerendraD Offline
                dheerendra
                Qt Champions 2022
                wrote on last edited by
                #7

                Try using the Qt.resolvedurl(..) to convert the local file system directory to upl and then give this as argument.

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                1 Reply Last reply
                3
                • A Anas A. Ismail

                  @p3c0 what the url should be if the files are on local file system ?

                  p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  @Anas-A.-Ismail Since you want to save/load from local fs you will need to use C++. The link which you posted explains how to create a plugin and register it so as to use it from QML. The plugin will contain code to access local file as well as your other required functions.

                  157

                  1 Reply Last reply
                  1
                  • I Offline
                    I Offline
                    IrisPanabaker
                    wrote on last edited by
                    #9

                    Use these tools if you are working with JSON.
                    http://jsonformatter.org
                    http://codebeautify.org/jsonviewer

                    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