summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@qt.io>2019-06-13 12:37:26 +0200
committerLars Knoll <lars.knoll@qt.io>2019-10-30 11:52:53 +0100
commitb76f66272692f39aaaaec7c398702f1585badf45 (patch)
tree65c45044bcf5385fa039b820e289dff61a5c8322 /tests/auto
parent5357231c0a10eef558cc6aebfd172048dc010a96 (diff)
Fix all tst_qmetatype breakages after QList to QVector aliasing
In Qt6 QList is just a typedef to QVector. To keep Qt5 behavior compatibility we need to register aliases, otherwise some type name based operations would not work. The patch adds automatic registration of QList metatype alias for every QVector. The patch doesn't cover usage of already typedef'ed and aliased QList and QVector, but that should be quite esoteric, especially after introduction of automatic QList and QVector type registration. Change-Id: I84672dda2b159d94e76cdc6034861e7d7ef52533 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 2a4ee55fa8..d300c31001 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -572,12 +572,14 @@ void tst_QMetaType::typeName_data()
QTest::newRow("124125534") << 124125534 << QString();
// automatic registration
- QTest::newRow("QList<int>") << ::qMetaTypeId<QList<int> >() << QString::fromLatin1("QList<int>");
QTest::newRow("QHash<int,int>") << ::qMetaTypeId<QHash<int, int> >() << QString::fromLatin1("QHash<int,int>");
QTest::newRow("QMap<int,int>") << ::qMetaTypeId<QMap<int, int> >() << QString::fromLatin1("QMap<int,int>");
- QTest::newRow("QVector<QList<int>>") << ::qMetaTypeId<QVector<QList<int> > >() << QString::fromLatin1("QVector<QList<int> >");
QTest::newRow("QVector<QMap<int,int>>") << ::qMetaTypeId<QVector<QMap<int, int> > >() << QString::fromLatin1("QVector<QMap<int,int> >");
+ // automatic registration with automatic QList to QVector aliasing
+ QTest::newRow("QList<int>") << ::qMetaTypeId<QList<int> >() << QString::fromLatin1("QVector<int>");
+ QTest::newRow("QVector<QList<int>>") << ::qMetaTypeId<QVector<QList<int> > >() << QString::fromLatin1("QVector<QVector<int> >");
+
QTest::newRow("CustomQObject*") << ::qMetaTypeId<CustomQObject*>() << QString::fromLatin1("CustomQObject*");
QTest::newRow("CustomGadget") << ::qMetaTypeId<CustomGadget>() << QString::fromLatin1("CustomGadget");
QTest::newRow("CustomGadget*") << ::qMetaTypeId<CustomGadget*>() << QString::fromLatin1("CustomGadget*");