QSettings *reg = new QSettings("HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM",QSettings::NativeFormat);
QStringList comm = reg->childKeys();//childKeys
foreach(QString key,comm){
qDebug() << key;
qDebug() << reg->value(key).toString();
}
为什么读的是空
------解决方案--------------------
QSettings 有这么一句话:
Note that the backslash character is, as mentioned, used by QSettings to separate subkeys. As a result, you cannot read or write windows registry entries that contain slashes or backslashes; you should use a native windows API if you need to do so.