Yes, i do this (stupid) iteration-stuff only for testing ;-)
Thanks, you give me the solution. Sorry i normaly work with C#. At C# it's not a "copy". okay, i will do it by ref, because i like the 'foreach' ;-)
PS: what a stumbling block!!!!
Added after 26 minutes:
I tried the "&", but i got an error.
// int i=-1;
foreach (FileEntry & itmFile, fileList)
{
//i++;
if((tmpType=="alle")||(itmFile.type==tmpType)) //Stimmt Typ?
{
if(itmFile.size+currentSize<maxSize) //Begrenzung noch nicht überschritten?
{
currentSize += itmFile.size;
itmFile.selected=true; //wird ausgewählt
//fileList[i].selected=true;
continue;
}
}
itmFile.selected=false; //wird nicht ausgewählt
//fileList[i].selected=false;
}
// int i=-1;
foreach (FileEntry & itmFile, fileList)
{
//i++;
if((tmpType=="alle")||(itmFile.type==tmpType)) //Stimmt Typ?
{
if(itmFile.size+currentSize<maxSize) //Begrenzung noch nicht überschritten?
{
currentSize += itmFile.size;
itmFile.selected=true; //wird ausgewählt
//fileList[i].selected=true;
continue;
}
}
itmFile.selected=false; //wird nicht ausgewählt
//fileList[i].selected=false;
}
To copy to clipboard, switch view to plain text mode
/usr/include/qt5/QtCore/qglobal.h:860: error: invalid initialization of reference of type 'FileEntry&' from expression of type 'const FileEntry'
for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
For your information:
QList<FileEntry> fileList;
QList<FileEntry> fileList;
To copy to clipboard, switch view to plain text mode
(no pointer)
Bookmarks