Nominate our 2022 Qt Champions!

QSettings->setValue , group contains space will save to %20 ?

  • If group contains space will save to %20, in Desktop Entry file of Linux will display mess code.

    writeSettings(filePath, "Desktop Entry", "Name", ui->lineEditName->text());
    void MainWindow::writeSettings(QString path, QString group, QString key, QString value)
        QSettings *settings = new QSettings(path, QSettings::IniFormat);
        settings->setValue(key, value);


  • From :

    The INI file format has severe restrictions on the syntax of a key. Qt works around this by using % as an escape character in keys.

Log in to reply