You need to provide the operator<<() and operator>>() implementation for your User class. Its prototype looks like:
Qt Code:
  1. QDataStream &operator<<(QDataStream &, const User &);
  2. QDataStream &operator>>(QDataStream &, User &);
To copy to clipboard, switch view to plain text mode 
Each should do whatever is necessary to save/restore the internal state of the User object.