Hi, I have a problem writting and reading QSettings...

Qt Code:
  1. void clientGui::read_settings() {
  2. QSettings settings(COMPANY, PRODUCT);
  3. tab_counter = settings.value("counter").toInt();
  4. for(quint32 i=0;i<tab_counter;i++) {
  5. tab_names.append(settings.value("tab"+tab_counter).toString());
  6. }
  7. }
  8.  
  9. void clientGui::write_settings() {
  10. /* TODO: spremeni ti dve imeni v dejanski imeni: ime_firme : ime_programa */
  11. QSettings settings(COMPANY, PRODUCT);
  12.  
  13. /* counter - number of additional tabs */
  14. settings.setValue("counter", tab_counter);
  15.  
  16. /* save the schema names */
  17. settings.setValue("tab"+tab_counter, tab_name);
  18. }
  19.  
  20. void clientGui::change_settings(QString name, bool read_write) {
  21. QSettings settings(COMPANY, PRODUCT);
  22.  
  23. /* i++ the counter - add one new tab */
  24. if(read_write) {
  25. tab_counter += 1;
  26. /* save the tab name */
  27. settings.setValue("tab"+tab_counter, name);
  28. }
  29. else if(tab_counter > 0) {
  30. tab_counter -= 1;
  31.  
  32. /* remove the name */
  33. settings.remove(name);
  34. }
  35. /* save the counter */
  36. settings.setValue("counter", tab_counter);
  37.  
  38. }
To copy to clipboard, switch view to plain text mode 

The problem is that my settings look like this:
[General]
ab=fadf
counter=0
b=erf
tab=
where it should look like this:
counter=0
tab0=X
tab1=X
tab2=X ... etc (where X is some name)

change_settings should add new tab[number] variable with a name...

What is the problem...any ideas?