Huh
Nowhere in this thread have you done anything like that.
Your code:
QList<CustomClass*> list;
out <<list; //works fine
QList<CustomClass*> list;
QDataStream out(&file);
out <<list; //works fine
To copy to clipboard, switch view to plain text mode
My code:
QList<CustomClass*> list;
out << list.size();
foreach(CustomClass* p, list)
out << *p;
QList<CustomClass*> list;
QDataStream out(&file);
out << list.size();
foreach(CustomClass* p, list)
out << *p;
To copy to clipboard, switch view to plain text mode
Wysota's prompting would give you something that would make your code work.
My code gives you another way to do it using the operator<<() for CustomClass that you already have.
Bookmarks