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. Resource System Volatility
Qt 6.11 is out! See what's new in the release blog

Resource System Volatility

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 2.3k 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
    Denis Dolzhenko
    wrote on last edited by Denis Dolzhenko
    #1

    Is the QT creator resource system non-volatile? Can I write some data to the .txt within the resource system file on the first run, and then restart the app and retrieve it back?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Yes and no. There are two modes in which you can use Qt's resources. The default one generates a c++ source file with the resources serialized into plain old c++ byte arrays and that gets compiled into the executable. Obviously you can't modify that without recompiling the app.

      The other mode is by using external binary resources. In this case the resources are compiled into a binary blob loaded at runtime. You can unload/modify/load that blob at runtime, without even restarting your app, but you still need that blob to be created using rcc.

      The source files for the resources (.like the .txt file you mentioned) are not deployed with the app. It gets compiled into the app or the external binary blob. If you want to just access modifiable files then you don't need a resource system at all. Just use the QFile api for them.

      1 Reply Last reply
      2
      • D Offline
        D Offline
        Denis Dolzhenko
        wrote on last edited by
        #3

        Is this the binary resource method you mentioned? Or do I need extra modifications to make it into one?

        0_1497740321729_Capture.PNG

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The image upload doesn't work on the forum. We can't see the picture. Please upload it to some external service and link here.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Denis Dolzhenko
            wrote on last edited by Denis Dolzhenko
            #5

            @Chris-Kawa
            Sorry, here you go

            http://imgur.com/a/1iDgH
            alt text

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Denis-Dolzhenko said in Resource System Volatility:

              Is this the binary resource method you mentioned?

              No, that's the first method - the files get compiled into the executable. See the link I posted on how to create a binary resource file (basicaly you run rcc -binary yourfile.qrc).

              D 1 Reply Last reply
              2
              • Chris KawaC Chris Kawa

                @Denis-Dolzhenko said in Resource System Volatility:

                Is this the binary resource method you mentioned?

                No, that's the first method - the files get compiled into the executable. See the link I posted on how to create a binary resource file (basicaly you run rcc -binary yourfile.qrc).

                D Offline
                D Offline
                Denis Dolzhenko
                wrote on last edited by
                #7

                @Chris-Kawa
                Okay, I'll look into that, thanks a lot!

                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