summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-03-14 15:15:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-22 11:52:23 +0100
commit5ea56e93f74c0df88aa956199e6bb0db2f17bfba (patch)
tree80e409f9b5ceeed8d8149cf8163de5bfb9b6b4aa
parent55fa3c189f88933d390177ad5606d3de9deacf93 (diff)
Reserve more space for built-in types in id space.
We are running out of type ids for built-in types, 255 is not enough. QMetaType already contains about ~70 types, situation is maybe not tragic now, but there is a great chance that we will want to add more built-in types from different modules like jsondb or declarative. Then it might be tight, because we are not allowed to reorganize type ids (it would be a binary incompatible change). This change was not possible up to now. Old moc generated code assumes that type id can be safely stored in 8 bits. This is source compatible change. Change-Id: Iec600adf6b6196a9f3f06ca6d865911084390cc2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
-rw-r--r--src/corelib/kernel/qmetatype.h2
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 9931df14e3..21f4bc7afe 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -210,7 +210,7 @@ public:
QReal = sizeof(qreal) == sizeof(double) ? Double : Float,
UnknownType = 0,
- User = 256
+ User = 1024
};
enum TypeFlag {
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index b6cb6b3632..1e382dde3a 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -2827,7 +2827,7 @@ Q_DECLARE_METATYPE( MyClass )
void tst_QVariant::loadUnknownUserType()
{
qRegisterMetaType<MyClass>("MyClass");
- char data[] = {0, 0, 1, 0, 0, 0, 0, 0, 8, 77, 121, 67, 108, 97, 115, 115, 0};
+ char data[] = {0, 0, QMetaType::User >> 8 , char(QMetaType::User), 0, 0, 0, 0, 8, 'M', 'y', 'C', 'l', 'a', 's', 's', 0};
QByteArray ba(data, sizeof(data));
QDataStream ds(&ba, QIODevice::ReadOnly);