[SOLVED] how to save all the results of the combobox to the config.ini file



  • is there a way to save all the results for the Qcombobox to the config.ini file. currently, all i can save is the first result of the combobox. for example, in the combobox if the first field has the name "test" then i am only able to save that name and no other fields in the combobox. i am asking if there is a way to save all the fields in the combobox. below is my code that is not working correctly.

    @ //save the result to the config.ini file
    QSettings settings("config.ini", QSettings::IniFormat);
    settings.setValue("userName", ui->userName->currentText());

    ui->userName->setEditable(true);
    ui->userName->addItem(userName2);
    
    // load ini settings
    QSettings settings("config.ini", QSettings::IniFormat);
    userName2 = settings.value("userName").toString();
    

    @



  • i solved it with arrays. bare with me i am still trying to understand c++ programming and i think i am just about there :)


Log in to reply
 

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