Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMake and resources
Qt 6.11 is out! See what's new in the release blog

QMake and resources

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 4.5k 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.
  • T Offline
    T Offline
    Thanatos.jsse
    wrote on last edited by
    #1

    Hi,

    I'm using on my application a binary resource, this is compiled using:

    @$ rcc -binary -no-compress myResource.qrc -o myResource.rcc@

    Then I copy the *.rcc to ${BUILD_PATH}/share folder. (¬¬ using cp $path_to_myResource path_to_mySharedFolder).

    The question is:

    How can I configure my *.pro file for let do this work (compile the resource file) to qmake tool?

    @# I've tried to use
    CONFIG += resources

    ...

    QMAKE_RESOURCE_FLAGS += -no-compress -binary
    @

    Thank your for your help.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomma
      wrote on last edited by
      #2

      Just adding
      @
      RESOURCES += <resource>.qrc
      @

      should do.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Thanatos.jsse
        wrote on last edited by
        #3

        [quote author="Tomma" date="1343370146"]Just adding
        @
        RESOURCES += <resource>.qrc
        @

        should do.[/quote]

        Yes Tomma, that's correct. All resource file must be added to RESOURCES variable.

        But how can I tell to qmake: Over this resource use rcc -binary -no-compress resource.qrc -o resourceOutput.rcc

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hostel
          wrote on last edited by
          #4

          QMake variable:
          @
          QMAKE_POST_LINK
          @

          You can create script which will make rcc file and copy to destination folder. Next you should add this script in QMAKE_POST_LINK. Don't forget to no add your qrc file to RESOURCES if you want load rcc dynamicly. Sorry for my flawed English.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Thanatos.jsse
            wrote on last edited by
            #5

            [quote author="Hostel" date="1343414031"]QMake variable:
            @
            QMAKE_POST_LINK
            @
            [/quote]

            Thank you Hoste, that is a good solution, I have only one problem, create each script to be used on each platform.

            PD: You make me look in google translate for word flawed :P

            Best regards,

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Hostel
              wrote on last edited by
              #6

              In near future I will use QMAKE_POST_LINK in my .pro file for creating rcc by script and I think that I will use Python - it's cross platform.

              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