Home > other >  QMap traversal (urgent!!!!! )
QMap traversal (urgent!!!!! )

Time:12-05

QMap _nameToValue; _nameToValue. Insert (" uu ", "*"); _nameToValue. Insert (" 11 ", "*"); _nameToValue. Insert (" hh ", "*"); _nameToValue. Insert (" 33 ", "*");//a QString string=""; QMap : : iterator iter=_nameToValue. The begin (); for(; Iter!=_nameToValue. End (); Iter++) {string=string + iter. Key () + ", "+ iter. Value () +", "; } the final output string: "11, *, 33, *, hh, *, uu, *," why not "11, uu, *, *, hh, *, 33, *,"?

CodePudding user response:

The Map at the time of insertion, automatically sort
  • Related