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

QSettings will still fall back onto any child groups specified in the fallback entries even if fallbacks are turned off

    XMLWordPrintable

Details

    Description

      QSettings will still fall back onto any child groups or child keys specified in the fallback entries even if fallbacks are turned off.


      Example:

      #include <QCoreApplication>
      #include <QSettings>
      #include <QStringList>
      #include <QDebug>

      int main(int argc, char *argv[])
      {
      QCoreApplication a(argc, argv);
      a.setOrganizationName("FooSoft");
      a.setOrganizationDomain("foosoft.com");
      a.setApplicationName("bar");

      QSettings sys(QSettings::SystemScope, qApp->organizationName(), qApp->applicationName());
      sys.beginGroup("somegroup");
      sys.beginGroup("someothergroup");
      sys.setValue("somevalue", "somedata");

      QSettings usr(QSettings::UserScope, qApp->organizationName(), qApp->applicationName());
      usr.setFallbacksEnabled(false);
      usr.beginGroup("somegroup");
      qDebug() << usr.childGroups();
      // at this point the group "someothergroup" is listed, although fallback is disabled
      }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes