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. Two Qt Resource Files (.qrc), switch while runtime
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 4.7k Views 1 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

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

    Thank You.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #2

      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
      0
      • M Offline
        M Offline
        mlong
        wrote on last edited by
        #3

        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
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          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
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            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
            0
            • ? This user is from outside of this forum
              ? This user is from outside of this forum
              Guest
              wrote on last edited by
              #6

              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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved