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. Overriding external binary resource (rcc) doesn't update its content
QtWS25 Last Chance

Overriding external binary resource (rcc) doesn't update its content

Scheduled Pinned Locked Moved Unsolved General and Desktop
resource
3 Posts 2 Posters 1.4k Views
  • 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.
  • Gregoire BorelG Offline
    Gregoire BorelG Offline
    Gregoire Borel
    wrote on last edited by Gregoire Borel
    #1

    I'm using external binary resources to set the graphical interface of my program.

    Everything works when I switch from redTheme.rcc to blueTheme.rcc: my interface is updated.

    Now let's say I want to update my redTheme.rcc from the outside of my program. I am able to detect that the file has been overridden by using the QFileSystemWatcher class. Here's what I do to update its content:

    QResource::unregisterResource("redTheme.rcc");
    QResource::registerResource("redTheme.rcc");
    

    Both commands return true. However, my graphical interface is not updated. It seems that the content of my resource is not overridden.

    I tried Q_CLEANUP_RESOURCE(redTheme) but it seems to only work with internal resources, such as my qml.qrc which contains my controllers and views.

    Is there a way to perform this?

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

      hi
      I have never tried this my self so this is only speculation:
      the docs says
      "The resource file passed into registerResource() must be a binary resource as created by rcc. "

      So when you say you change it "outside of my program" , it means you compile a new version with rcc and copy it over?
      If yes, have you try to flipflop
      between red/blue to really force a reload of the changed one ?
      With reload I mean for how ever you use the data in the rcc file.

      1 Reply Last reply
      0
      • Gregoire BorelG Offline
        Gregoire BorelG Offline
        Gregoire Borel
        wrote on last edited by Gregoire Borel
        #3

        @mrjj said:

        it means you compile a new version with rcc and copy it over?

        Yes, it's generated from my CMakeLists.txt. No problem whatsoever with the generation.

        If yes, have you try to flipflop

        I did. It doesn't work. When going back to redTheme.rcc, the content is still the same as it was in first hand.

        Note that I shared my problem on stackoverflow, and according to one of the replies, it's a bug.

        Therefore, I reported it to the Qt bug tracker.

        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