Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66298

Windows: QCoreApplication::applicationVersion fails to read PRODUCTVERSION from .rc file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.6.3, 5.7.1
    • Core: Resource System
    • None
    • Windows 10 MSVC2013 Qt5.6.3

    Description

      QCoreApplication::applicationVersion fails to read PRODUCTVERSION from .rc file.  After defining VERSION and a few other variables in .pro file, an .rc file is generated with the appropriate information.  Running it from QtCreator with an appropriate debug statement prints "" for QCoreApplication::applicatioVersion.

      Appears to work correctly with newer versions of Qt (5.9.*, 5.10.*)

      Example attached

      Since 5.6 is an LTS, I hope this will be fixed in >=5.6.4?

      After examining the differences between working and nonworking versions, the includes in the generated RC files appear to be the main difference (whether that's the cause of the issue or it's something deeper in QCoreApplication, I'm not sure).  Files attached, and difference below:
      5.6.3:

      \# if defined(UNDER_CE)
      \# include <winbase.h>
      \# else
      \# include <windows.h>
      \# endif
      

      5.10.0:

       #include <windows.h>
      

      Attachments

        1. main.cpp
          0.5 kB
        2. main.qml
          0.1 kB
        3. qml.qrc
          0.1 kB
        4. qtbug66298.zip
          1 kB
        5. versionTest_resource.rc.5.10.0
          0.7 kB
        6. versionTest_resource.rc.5.6.3
          0.7 kB
        7. versionTest.pro
          1 kB

        Issue Links

          Activity

            People

              hjk hjk
              dchamberlain David Chamberlain
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: