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. How to read a json file without using the qrc ?
Qt 6.11 is out! See what's new in the release blog

How to read a json file without using the qrc ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 292 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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    I just want to load some json data from the files.But I dont want the user read the json file,so is there any ways that could load the json file from the dll or something else?

    M 1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      I don't understand your question. What files, what DLL? What JSON and what do you want it to do with it?

      If you supply a file which the program needs to read but the user does not then putting it into the executable as a Qt resource seems an excellent way. It already does that when you use qrc:/... as a file path, so I don't understand why you are asking not to use it, seems the opposite of what you want?

      If you want to supply files externally then you won't use Qt resources/qrc, you can load them with code. There are Qt classes for reading JSON data.

      1 Reply Last reply
      2
      • nicker playerN nicker player

        I just want to load some json data from the files.But I dont want the user read the json file,so is there any ways that could load the json file from the dll or something else?

        M Offline
        M Offline
        mpergand
        wrote on last edited by
        #3

        @nicker-player
        Simply create a string variable with your json contents in any file you want.

        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