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

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

XMLWordPrintable

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

      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>
      

        1. main.cpp
          0.5 kB
          David Chamberlain
        2. main.qml
          0.1 kB
          David Chamberlain
        3. qml.qrc
          0.1 kB
          David Chamberlain
        4. versionTest.pro
          1 kB
          David Chamberlain
        5. versionTest_resource.rc.5.6.3
          0.7 kB
          David Chamberlain
        6. versionTest_resource.rc.5.10.0
          0.7 kB
          David Chamberlain
        7. qtbug66298.zip
          1 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes