Save and load QList<Class*> to file
问题 I have a class ContactData and a class FriendList holding a QList and I overloaded the << / >> operators. contactdata.h class ContactData { //all public for testing public: ContactData(); QString m_name; QString m_description; bool m_online; }; QDataStream &operator<<(QDataStream& out, ContactData& contactData); QDataStream &operator>>(QDataStream& in, ContactData* contactData); contactdata.cpp QDataStream &operator<<(QDataStream &out, ContactData& contactData) { out << contactData.m_name;