In windows 7, Use QSettings visit registory,Some Keys and Values do not show.



  • In windows 7, Use QSettings visit registory,Some Keys and Values do not show.
    My code as below:
    void MainWindow::on_pushButton_clicked()
    {
    ui->listWidget->clear();
    QString str = ui->lineEdit->text();
    QSettings reg(str, QSettings::NativeFormat);
    QStringList keyList=reg.childKeys();
    foreach(QString key, keyList)
    {
    QString location=reg.value(key).toString();
    if(!location.isEmpty())
    {
    ui->listWidget->addItem(key + " = " + location);
    }
    }
    }
    user regedit I can see 4 keys,bug my qt code only show 3 keys. I user Qt4.8.7 and Qt5.8.0,has the same problom. the picture as below:
    1_1499156529061_qt-show.png 0_1499156529060_regedit-show.png



  • Your Qt application is showing 32bit side and regedit 64bit (notice different InstallRoot value).
    Windows separates registry for 64bit and 32bit environment check if either path has some WOW64 part.



  • @tomma ,Thank you very much . yes, you are right. I find the problem immediately when I posted it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.