[PyQt] using pickle to save contents of QSortFilterProxyModel

Hans Meine meine at informatik.uni-hamburg.de
Tue Nov 23 15:02:58 GMT 2010


Op den Sünnavend 20 November 2010 Klock 07:48:15 hett Phil Thompson schreven:
> Pickling of QObject instances isn't supported because there is so much
> state information (some of which you probably don't have access to) that
> you would need to restore.

Yet pickling QDate, QDateTime, and QString seems to be supported.

So instead of
  pickle.dump(newModel, file)
try something like
  pickle.dump(newModel.getAllDataAsPythonList(), file)

HTH,
  Hans


More information about the PyQt mailing list