From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.
dijnr last edited by
Hi, I'm having some problem using Qsetting library..
I have my application and I must save some variables , so that if you reopen the program you don't have to restart from zero.
I wasn't able to make it work with this kind of data. Any Hints or Solution?
Hi, welcome to the forum.
QSettings operates on QVariant to store/read the data. You need to make your types known to Qt's type system for them to be used as QVariant and they need to have a registered streaming operators to be serialized.
See these docs for more info: Q_DECLARE_METATYPE, Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE, qRegisterMetaTypeStreamOperators.
There's also a problem with your last type. Don't save pointers (MyClass*). After your app restart they would point to garbage. Your stream operator for that container should save the actual objects data and recreate the object from that data on load.