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

QSettings can't read some of HKLM registry entry

    XMLWordPrintable

    Details

    • Platform/s:
      Windows

      Description

      I have installed the SDCC toolchain v3.9.0 (64-bit installer) to the "Program Files" folder, and want to read the registry entries in:

      "HKEY_LOCAL_MACHINE\SOFTWARE\SDCC"

      path (e.g to read an installed path, version and so on). But, the QSettings returns an empty strings., e.g. this code:

      #include <QCoreApplication>
      #include <QSettings>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\SDCC";
          QSettings registry(QLatin1String(kRegistryNode), QSettings::NativeFormat);
          QString rootPath = registry.value(QStringLiteral("Default")).toString();
          qDebug() << rootPath;
          return a.exec();
      }
      

      returns the 'rootPath' as empty string.

      I don't know, what is reason (maybe the access rights?), but if I open the Regedit (trough Win + R) and then I see there all entries (please see screenshoot).

        Attachments

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

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              kuzulis Denis Shienkov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes