Qt RC_FILE vs automatic resource file conflict

  • 0 down vote favorite

    Trying to add an app icon to Qt application. Simple solution for Qt 5.1 and higher is to use
    @RC_ICONS += app.ico @

    This doesn't work for earlier versions, so one has to include *.rc file with

    However this breaks another Qt functionality concerning resource files, for example adding application version with VERSION variable.

    When just VERSION variable is used, there is _resource.res file generated automatically during build (rcc is involved):


    After I add RC_FILE += ico.rc, rcc invoke is the same except rc and res files names, but resulting application doesn't have any version information.


    Is there a way to incorporate both automatic and custom rc-files?

  • Lifetime Qt Champion


    To workaround that, you can test what the current version of Qt is in your pro file and use one technique or the other.

    However, it might be considered a regression. You should check the "bug report system":http://bugreports.qt-project.org to see if it's something known. If not, please consider opening a new report providing a minimal compilable example showing how to reproduce this behavior.

  • The only workaround I currently happened to get is to first run qmake to create auto-generated *.rc file in build folder, then insert IDI_ICON1 line there and build.

Log in to reply