Hi everyone,

In my program, i need to read an ini file to an array. here is my ini file:
Qt Code:
  1. [Config]
  2. Number1=156
  3. Number2=4
  4.  
  5. [StageNum]
  6. 1\cy1\7
  7. 1\cy1\2
  8. 1\cy1\5
  9. 1\cy1\2
  10. 1\cy1\3
  11. 1\cy1\0
To copy to clipboard, switch view to plain text mode 

in "StageNum", the first digit indicates all number in the same group (that's what i understand). "cy1" represents the name of array. the third digit is the value i want to read and save into an array.

i can read the single value in "config" successfully in my code, but i could not read "StageNum" into an array at all. Can anyone point out for me:

1) if the format of array setting is correct in ini file? if not, what is the right format?
2) if the format of array is correct in ini file, where does my code go wrong?

here is part of my code:
Qt Code:
  1. int arySize = m4Settings->beginReadArray("StageNum");
  2. for (int vL = 0; vL < arySize; vL ++)
  3. {
  4. m4Settings->setArrayIndex(vL);
  5. stageNo[vL] = m4Settings->value("cy1","0").toInt();
  6. }
  7. m4Settings->endArray();
To copy to clipboard, switch view to plain text mode 
when i step through the code, the "arySize" read 0 instead of 6.

Thanks in advance.