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

Provide a way to get an actual OS version

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • QPA
    • None
    • d05f2fb2d (dev), 4034cc7c1 (6.5), de310d34c (6.4)

    Description

      I'm using QSysInfo::productVersion. For me, it returns 10.0 under Windows 11, and 10.16 under macOS Big Sur, macOS Monterey.

      It's NOT a Qt bug. It's the way these OSes behaves. However, it's still possible to detect actual versions.

      Windows: one have to use RtlGetVersion + some additional tricks.
      https://stackoverflow.com/questions/69373447/is-there-an-official-way-to-detect-windows-11.

      macOS: version can be read from this file: /System/Library/CoreServices/.SystemVersionPlatform.plist
      https://stackoverflow.com/questions/75413538/troubles-getting-an-actual-macos-version

       

      So, I suggest something like QSysInfo::nonCompatProductVersion. It should try to do its best to detect an actual version. But it should be explicitly stated in the docs, that there is no guarantee for it to work 100% accurate.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vestbo Tor Arne Vestbø
              alervd Alexander Dyagilev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: