Qt Forum

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

    Unsolved Using .rcc File Generated By rcc tool in qmake project

    Tools
    2
    2
    209
    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.
    • S
      Shahazan Ali last edited by Shahazan Ali

      Hi,

      My goal is to add a zip file in my application and use it (by extracting somewhere else in user's computer) as qt resource system. However, in .pro file, using RESOURCES variable to add a zip file in a qrc file, ends with a CPP file that compiles and eventually embeds into exe. My zip file is relatively bigger and compilation takes time. So I want to add it as binary file in my pro file. I can generate a .rcc file using the rcc tool (rcc -no-compress -binary zipfile.qrc -o zipfile.rcc). Now the question is how can I embed the zipfile.rcc into my application exe so that I can use it as qt normal resource system way.

      Note that, I can easily do that with qt5_add_binary_resources function in make, that actually embeds a binary resources into app and does not generate cop file for it. Wondering what is the make equivalent of it.

      Thanks a lot in advance!

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        You can load external resources using Q_INIT_RESOURCE in c++ code.

        If you mean to ask how to generate rcc file using qmake (without using RESOURCES), then it's pretty easy. For example:

        QMAKE_POST_LINK += $$[QT_INSTALL_BINS]/rcc -no-compress -binary zipfile.qrc -o zipfile.rcc
        

        This will generate a standalone RCC file. You can also use a custom compiler for this if you want to.

        (Z(:^

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