diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-05-27 09:58:12 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-06-20 20:01:33 +0200 |
commit | 03326a2fec416405b437089874f6439e937bbada (patch) | |
tree | 48d7137c3cd5e6f537e06e97380d3c1e76a56af9 /tests/auto/corelib/kernel | |
parent | 1a9a4af388477efd9f7008d5c0bb74432c20279d (diff) |
Move implementation of QVector/List back to qlist.h
And name the main class QList. That's also the one we document.
This gives less porting pain for our users, and a lot less churn
in our API, as we use QList in Qt 5 in 95% of our API.
In addition, it gives more consistent naming with QStringList and
QByteArrayList and disambiguates QList vs QVector(2|3|4)D.
Fixes: QTBUG-84468
Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r-- | tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp | 33 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 6 |
2 files changed, 20 insertions, 19 deletions
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 0091636172..a8f6914115 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -1320,13 +1320,13 @@ void tst_QMetaObject::normalizedSignature_data() QTest::newRow("function ptr spaces") << "void foo( void ( * ) ( void ))" << "void foo(void(*)())"; QTest::newRow("function ptr void*") << "void foo(void(*)(void*))" << "void foo(void(*)(void*))"; QTest::newRow("function ptr void* spaces") << "void foo( void ( * ) ( void * ))" << "void foo(void(*)(void*))"; - QTest::newRow("template args") << " void foo( QMap<a, a>, QVector<b>) " - << "void foo(QMap<a,a>,QVector<b>)"; + QTest::newRow("template args") << " void foo( QMap<a, a>, QList<b>) " + << "void foo(QMap<a,a>,QList<b>)"; QTest::newRow("void template args") << " void foo( Foo<void>, Bar<void> ) " << "void foo(Foo<void>,Bar<void>)"; QTest::newRow("void* template args") << " void foo( Foo<void*>, Bar<void *> ) " << "void foo(Foo<void*>,Bar<void*>)"; - QTest::newRow("rettype") << "QVector<int, int> foo()" << "QVector<int,int>foo()"; + QTest::newRow("rettype") << "QList<int, int> foo()" << "QList<int,int>foo()"; QTest::newRow("rettype void template") << "Foo<void> foo()" << "Foo<void>foo()"; QTest::newRow("const rettype") << "const QString *foo()" << "const QString*foo()"; QTest::newRow("const ref") << "const QString &foo()" << "const QString&foo()"; @@ -1337,18 +1337,18 @@ void tst_QMetaObject::normalizedSignature_data() QTest::newRow("const4") << "void foo(const int)" << "void foo(int)"; QTest::newRow("const5") << "void foo(const int, int const, const int &, int const &)" << "void foo(int,int,int,int)"; - QTest::newRow("const6") << "void foo(QVector<const int>)" << "void foo(QVector<const int>)"; - QTest::newRow("const7") << "void foo(QVector<const int*>)" << "void foo(QVector<const int*>)"; - QTest::newRow("const8") << "void foo(QVector<int const*>)" << "void foo(QVector<const int*>)"; + QTest::newRow("const6") << "void foo(QList<const int>)" << "void foo(QList<const int>)"; + QTest::newRow("const7") << "void foo(QList<const int*>)" << "void foo(QList<const int*>)"; + QTest::newRow("const8") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)"; QTest::newRow("const9") << "void foo(const Foo<Bar>)" << "void foo(Foo<Bar>)"; QTest::newRow("const10") << "void foo(Foo<Bar>const)" << "void foo(Foo<Bar>)"; QTest::newRow("const11") << "void foo(Foo<Bar> *const)" << "void foo(Foo<Bar>*)"; QTest::newRow("const12") << "void foo(Foo<Bar>const*const *const)" << "void foo(const Foo<Bar>*const*)"; QTest::newRow("const13") << "void foo(const Foo<Bar>&)" << "void foo(Foo<Bar>)"; QTest::newRow("const14") << "void foo(Foo<Bar>const&)" << "void foo(Foo<Bar>)"; - QTest::newRow("QList") << "void foo(QList<int>)" << "void foo(QVector<int>)"; - QTest::newRow("QList1") << "void foo(const Template<QList, MyQList const>)" - << "void foo(Template<QVector,const MyQList>)"; + QTest::newRow("QVector") << "void foo(QVector<int>)" << "void foo(QList<int>)"; + QTest::newRow("QVector1") << "void foo(const Template<QVector, MyQList const>)" + << "void foo(Template<QList,const MyQList>)"; QTest::newRow("refref") << "const char* foo(const X &&,X const &&, const X* &&) && " << "const char*foo(const X&&,const X&&,const X*&&)&&"; @@ -1373,13 +1373,13 @@ void tst_QMetaObject::normalizedType_data() QTest::newRow("white") << " int " << "int"; QTest::newRow("const1") << "int const *" << "const int*"; QTest::newRow("const2") << "const int *" << "const int*"; - QTest::newRow("template1") << "QVector<int const *>" << "QVector<const int*>"; - QTest::newRow("template2") << "QVector<const int *>" << "QVector<const int*>"; + QTest::newRow("template1") << "QList<int const *>" << "QList<const int*>"; + QTest::newRow("template2") << "QList<const int *>" << "QList<const int*>"; QTest::newRow("template3") << "QMap<QString, int>" << "QMap<QString,int>"; QTest::newRow("template4") << "const QMap<QString, int> &" << "QMap<QString,int>"; - QTest::newRow("template5") << "QVector< ::Foo::Bar>" << "QVector<::Foo::Bar>"; - QTest::newRow("template6") << "QVector<::Foo::Bar>" << "QVector<::Foo::Bar>"; - QTest::newRow("template7") << "QVector<QVector<int> >" << "QVector<QVector<int>>"; + QTest::newRow("template5") << "QList< ::Foo::Bar>" << "QList<::Foo::Bar>"; + QTest::newRow("template6") << "QList<::Foo::Bar>" << "QList<::Foo::Bar>"; + QTest::newRow("template7") << "QList<QList<int> >" << "QList<QList<int>>"; QTest::newRow("template8") << "QMap<const int, const short*>" << "QMap<const int,const short*>"; QTest::newRow("template9") << "QPair<const QPair<int, int const *> , QPair<QHash<int, const char*> > >" #ifdef _LIBCPP_VERSION @@ -1387,7 +1387,7 @@ void tst_QMetaObject::normalizedType_data() #else << "std::pair<const std::pair<int,const int*>,std::pair<QHash<int,const char*>>>"; #endif - QTest::newRow("template10") << "QList<int const * const> const" << "QVector<const int*const>"; + QTest::newRow("template10") << "QVector<int const * const> const" << "QList<const int*const>"; QTest::newRow("template11") << " QSharedPointer<QVarLengthArray< QString const, ( 16>> 2 )> > const & " << "QSharedPointer<QVarLengthArray<const QString,(16>>2)>>"; QTest::newRow("template_sub") << "X<( Y < 8), (Y >6)> const & " << "X<(Y<8),(Y>6)>"; @@ -1402,7 +1402,8 @@ void tst_QMetaObject::normalizedType_data() QTest::newRow("struct2") << "struct foo const*" << "const foo*"; QTest::newRow("enum") << "enum foo" << "foo"; QTest::newRow("void") << "void" << "void"; - QTest::newRow("QList") << "QList<int>" << "QVector<int>"; + QTest::newRow("QList") << "QList<int>" << "QList<int>"; + QTest::newRow("QVector") << "QVector<int>" << "QList<int>"; QTest::newRow("refref") << "X const*const&&" << "const X*const&&"; QTest::newRow("refref2") << "const X<T const&&>&&" << "const X<const T&&>&&"; QTest::newRow("long1") << "long unsigned int long" << "unsigned long long"; diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 651efa53cf..48b46dd98f 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -583,11 +583,11 @@ void tst_QMetaType::typeName_data() // automatic registration 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<QMap<int,int>>") << ::qMetaTypeId<QVector<QMap<int, int> > >() << QString::fromLatin1("QVector<QMap<int,int>>"); + QTest::newRow("QVector<QMap<int,int>>") << ::qMetaTypeId<QVector<QMap<int, int> > >() << QString::fromLatin1("QList<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("QList<int>") << ::qMetaTypeId<QList<int> >() << QString::fromLatin1("QList<int>"); + QTest::newRow("QVector<QList<int>>") << ::qMetaTypeId<QVector<QList<int> > >() << QString::fromLatin1("QList<QList<int>>"); QTest::newRow("CustomQObject*") << ::qMetaTypeId<CustomQObject*>() << QString::fromLatin1("CustomQObject*"); QTest::newRow("CustomGadget") << ::qMetaTypeId<CustomGadget>() << QString::fromLatin1("CustomGadget"); |