I don't belive in my eyes. I wrote a foreach to change a bool value... (bool FileEntry.selected)

Qt Code:
  1. int i=-1;
  2. foreach (FileEntry itmFile, fileList)
  3. {
  4. i++;
  5. if((tmpType=="alle")||(itmFile.type==tmpType)) //Stimmt Typ?
  6. {
  7. if(itmFile.size+currentSize<maxSize) //Begrenzung noch nicht überschritten?
  8. {
  9. currentSize += itmFile.size;
  10. //itmFile.selected=true; //wird ausgewählt
  11. fileList[i].selected=true;
  12. continue;
  13. }
  14. }
  15. //itmFile.selected=false; //wird nicht ausgewählt
  16. fileList[i].selected=false;
  17. }
To copy to clipboard, switch view to plain text mode 

..and the (now) commted entries like "itmFile.selected=true" change the value only for/in the foreach! After the foreach is done, the value is false, like before. But when i use something like "fileList[i].selected=true", the value is after leaving the foreach is still 'true'. Is that normal???


thx.cit