Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Two Qt Resource Files (.qrc), switch while runtime

    General and Desktop
    3
    6
    4233
    Loading More Posts
    • 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.
    • ?
      Guest last edited by

      I have two Resource Files (.qrc) how can I switch between them in Qt C++ while runtime?

      Thank You.

      1 Reply Last reply Reply Quote 0
      • S
        soroush last edited by

        I think you can't. AFAIK all resources are compiled into C++ sources by rcc. Then compiled by C++ compiler and linked to other parts of your program.

        1 Reply Last reply Reply Quote 0
        • M
          mlong last edited by

          Look at "QResource":/doc/qt-4.8/qresource.html#dynamic-resource-loading under dynamic loading and unloading.

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply Reply Quote 0
          • ?
            Guest last edited by

            I already tried it with the dynamical loading link, but i can not switch to the second one.
            Is it possible with the .qrc files, too? I registered both files, setting one happens with setFileName() right?
            That does not work at my example, are there any additional terms?

            1 Reply Last reply Reply Quote 0
            • A
              andre last edited by

              Did you experiment with QResource::unregisterResource? I have never tried using it myself, but it seems that nothing can reference anything in the resource when you unload it. No idea if that is a problem in practice.

              1 Reply Last reply Reply Quote 0
              • ?
                Guest last edited by

                I tried it, but it does not work.

                I forgot to they, that I want to use it on Windows.

                I think it is a problem with the path. I need an absolute path, starting with /, so it seems it is Linux based.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post