summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-05-15 15:40:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-18 21:42:58 +0200
commit8df298665a1e637ab6d26d5fcc447d5502afe31a (patch)
tree9d36f54835b70b04bd6ae0bc72aee2a8ea659143 /src/corelib/kernel/qvariant.cpp
parent6c06e14a49773ce5572935864ed6b9be219c6103 (diff)
Move QIcon metatype handlers back to QtGui
QIcon has been moved back from QWidget to QtGui, so the QIcon QVariant and QMetaType handler can now be moved back to QtGui. Also we can give back QIcon its old number, allowing to get rid of some compatibility hack when unstreaming QVariant Change-Id: I439d5c2987c06ecd619f394407850f678164afb8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r--src/corelib/kernel/qvariant.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index cb50603354..3d3183a5c9 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1669,18 +1669,12 @@ void QVariant::load(QDataStream &s)
// In Qt4 id == 128 was FirstExtCoreType. In Qt5 ExtCoreTypes set was merged to CoreTypes
// by moving all ids down by 97.
typeId -= 97;
- } else if (typeId == 69 /* QIcon */) {
- // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
- typeId = QMetaType::QIcon;
} else if (typeId == 75 /* QSizePolicy */) {
typeId = QMetaType::QSizePolicy;
- } else if (typeId >= 70) {
+ } else if (typeId > 75 && typeId <= 86) {
// and as a result these types received lower ids too
- if (typeId <= 74) { // QImage QPolygon QRegion QBitmap QCursor
- typeId -=1;
- } else if (typeId <= 86) { // QKeySequence QPen QTextLength QTextFormat QMatrix QTransform QMatrix4x4 QVector2D QVector3D QVector4D QQuaternion
- typeId -=2;
- }
+ // QKeySequence QPen QTextLength QTextFormat QMatrix QTransform QMatrix4x4 QVector2D QVector3D QVector4D QQuaternion
+ typeId -=1;
}
}
@@ -1744,18 +1738,11 @@ void QVariant::save(QDataStream &s) const
// In Qt4 id == 128 was FirstExtCoreType. In Qt5 ExtCoreTypes set was merged to CoreTypes
// by moving all ids down by 97.
typeId += 97;
- } else if (typeId == QMetaType::QIcon) {
- // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
- typeId = 69;
} else if (typeId == QMetaType::QSizePolicy) {
typeId = 75;
- } else if (typeId >= QMetaType::QImage) {
+ } else if (typeId >= QMetaType::QKeySequence && typeId <= QMetaType::QQuaternion) {
// and as a result these types received lower ids too
- if (typeId <= QMetaType::QCursor) {
- typeId +=1;
- } else if (typeId <= QMetaType::QQuaternion) {
- typeId +=2;
- }
+ typeId +=1;
}
}
s << typeId;