summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-10-09 13:34:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 08:14:48 +0200
commit5c301f4121b4395b968ef3d6404986326ce70048 (patch)
treeeedec16bd796df01905b6b7a972d21ade11d5b43 /src
parentcd13fe44cd76e7aa821678fba58cb7d552aab2c3 (diff)
Account for QPolygonF type when loading/saving the QVariant
When the QPolygonF type was added to QMetaType it did not bump up the values in load() and save() for QVariant. Task-number: QTBUG-33981 Change-Id: I7ad99cda70620c5449c15527c3daf920972d047f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qvariant.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 20e13a050f..5754af42ac 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1892,6 +1892,7 @@ void QVariant::load(QDataStream &s)
void QVariant::save(QDataStream &s) const
{
quint32 typeId = type();
+ bool fakeUserType = false;
if (s.version() < QDataStream::Qt_4_0) {
int i;
for (i = 0; i <= MapFromThreeCount - 1; ++i) {
@@ -1916,12 +1917,16 @@ void QVariant::save(QDataStream &s) const
} else if (typeId >= QMetaType::QKeySequence && typeId <= QMetaType::QQuaternion) {
// and as a result these types received lower ids too
typeId +=1;
+ } else if (typeId == QMetaType::QPolygonF) {
+ // This existed in Qt 4 only as a custom type
+ typeId = 127;
+ fakeUserType = true;
}
}
s << typeId;
if (s.version() >= QDataStream::Qt_4_2)
s << qint8(d.is_null);
- if (d.type >= QVariant::UserType) {
+ if (d.type >= QVariant::UserType || fakeUserType) {
s << QMetaType::typeName(userType());
}