I have a QList element named competence inside a class, and another class object named k. I want to make a deep copy( this.competence must be a deep copy of k.competence ). I use an iterator it:
QList< QString>::iterator it;
for( it = k.competence->begin(); it != k.competence->end(); ++it )
{
this.competence << (*it) ;
}
I got an error "no match for operator<<". The problem is whenever I try this out of a loop:
QList< QString>::iterator it;
it = k.competence->begin();
this.competence << *it;
it doesn't give errors.
EDIT: RESOLVED using QList.append() method instead of operator<<