Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] how to save all the results of the combobox to the config.ini file
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kalster
    wrote on last edited by
    #1

    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();
    

    @

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kalster
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved