Commit 2e2d0778 authored by Daniel Teske's avatar Daniel Teske
Browse files

PersistentData: Allow for user types with suitable conversions

I ended up not needing that, but this might be useful for others.

Change-Id: Ie3a5a731d9f3f3f456d7cd4164cfa1753e2b54f1
Reviewed-by: default avatarEike Ziller <>
parent d9425c5c
......@@ -90,6 +90,13 @@ static QRect stringToRectangle(const QString &v)
\li list
You can register string-serialize functions for custom types by registering them in the Qt Meta
type system. Example:
QMetaType::registerConverter<QString, MyCustomType>(&myCustomTypeFromString);
When entering a value element ( \c <value> / \c <valuelist> , \c <valuemap> ), entry is pushed
accordingly. When leaving the element, the QVariant-value of the entry is taken off the stack
and added to the stack entry below (added to list or inserted into map). The first element
......@@ -329,7 +336,7 @@ QVariant ParseContext::readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttr
QVariant value;
return value;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment