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

QSettings::value reads empty values from HKEY_LOCAL_MACHINE branch

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.0, 5.7.0
    • Core: Other
    • None
    • Tested on Windows 7 and Windows 10, Qt 5.4.0 and Qt 5.7.0

    Description

      I tried to get the path of an installed application from the Windows registry. I can read values from HKEY_CLASSES_ROOT but reading any registry value from the HKEY_LOCAL_MACHINE branch (where installed applications tend to be) returns an empty value. Tested it with a DWORD key too.

      Sample code:

      QSettings windowsRegistry("HKEY_CLASSES_ROOT\\*", QSettings::NativeFormat);
      QString Path = windowsRegistry.value("ContentViewModeLayoutPatternForBrowse", "").toString();
      qDebug() << Path;			//works fine
      
      QSettings windowsRegistrySteam("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 22320", QSettings::NativeFormat);
      QString PathSteam = windowsRegistrySteam.value("InstallLocation", "").toString();
      qDebug() << PathSteam;		//Does not work. Basically reading any registry value from the HKEY_LOCAL_MACHINE branch returns an empty value. Tested it with a DWORD key too.
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            vikmorrohun Viktor Dózsa
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes