Quote Originally Posted by anda_skoa View Post
The operators are fine.

The issue is that you are not writing your object into the stream but its pointer.

Qt Code:
  1. QFile file("test.txt");
  2. if(file.open(QIODevice::WriteOnly ))
  3. {
  4. QDataStream stream;
  5. stream.setDevice(&file);
  6. stream << *w; // dereference the pointer and write the actual object
  7. file.close();
  8. }
To copy to clipboard, switch view to plain text mode 



Cheers,
_

Thanks for spotting that for me..

As a recommendation: don't use QObject as a base class unless you need it. Here actual "value" type classes would likely better.
Currently you are leaking all entries in itemList
Will make sure to use QObject only if I need so.
I guess parenting the entries int the itemList will stop the leak. Correct me if i'm mistaken.