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

  • 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:


    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?

  • Lifetime Qt Champion

    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.

  • @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.

Log in to reply