How do I read the windows registry (Default) value using QSettings?


Question

I want to read the registry to find the current PowerPoint version.

However this just returns Zero:

QSettings settings("HKEY_CLASSES_ROOT\\PowerPoint.Application\\CurrVer",
                   QSettings::NativeFormat);

QString sReturnedValue = settings.value("(Default)", "0").toString();

Any suggestions as to how I get the value from a (default) key?

1
6
11/8/2012 6:43:04 AM

Accepted Answer

Ok, just figured it out. Whilst regedit shows it as (Default) you just read it as Default.

QString sReturnedValue = settings.value( "Default", "0" ).toString();

Thanks for listening.

10
11/8/2012 6:43:27 AM

Also, a period works:

RegReader.value(".", NULL).toString();

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon