Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.11.1
-
None
-
FC28
Description
The attempt to persist a QList<QString> using the QSettings.setValue() method seems to work well, but after restarting the application, the attempt to deserialize gives the error message:
QVariant::load: unknown user type with name QList<QString>
persisting code:
QSettings settings; QList<QString> data {"first", "second", "third"}; settings.setValue("sourceList", QVariant::fromValue(data));
primitive types of objects are working well.
I am porting an existing application written for macOS and Windows to Linux. On Windows and macOS it seems to work, but I cannot verify this.
After analyzing the existing code, I identified, that a registration of an stream operator, before the QApplication is instantiated, solves the problem.
qRegisterMetaTypeStreamOperators<QList<QString>>("Data");
QApplication a(argc, argv);
Why this seems not to be necessary on non linux environment is not clear to me.