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/tools/moc | |
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/tools/moc')
-rw-r--r-- | tests/auto/tools/moc/allmocs_baseline_in.json | 12 | ||||
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 22 |
2 files changed, 9 insertions, 25 deletions
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json index 7b025963e2..85751845c4 100644 --- a/tests/auto/tools/moc/allmocs_baseline_in.json +++ b/tests/auto/tools/moc/allmocs_baseline_in.json @@ -1251,7 +1251,7 @@ "required": false, "scriptable": true, "stored": true, - "type": "QVector<Foo::Bar::Flags>", + "type": "QList<Foo::Bar::Flags>", "user": false, "write": "setFlagsList" } @@ -2699,7 +2699,7 @@ "access": "public", "arguments": [ { - "type": "QVector<QVector<int>>" + "type": "QList<QList<int>>" } ], "name": "foo", @@ -2709,7 +2709,7 @@ "access": "public", "arguments": [ { - "type": "QVector<QVector<int>>" + "type": "QList<QList<int>>" } ], "name": "foo2", @@ -2719,7 +2719,7 @@ "access": "public", "arguments": [ { - "type": "QVector<::AAA::BaseA*>" + "type": "QList<::AAA::BaseA*>" } ], "name": "bar", @@ -2729,7 +2729,7 @@ "access": "public", "arguments": [ { - "type": "QVector<::AAA::BaseA*>" + "type": "QList<::AAA::BaseA*>" } ], "name": "bar2", @@ -2739,7 +2739,7 @@ "access": "public", "arguments": [ { - "type": "QVector<const ::AAA::BaseA*>" + "type": "QList<const ::AAA::BaseA*>" } ], "name": "bar3", diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 4a6d16b45a..05ad63e4ba 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1804,32 +1804,16 @@ signals: class QTBUG12260_defaultTemplate_Object : public QObject { Q_OBJECT public slots: -#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN) void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>() ) { Q_UNUSED(values); } void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val = QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >() ) { Q_UNUSED(val); } -#else - // we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has. - typedef QHash<QString, QVariant> WorkaroundGCCBug; - void doSomething(QHash<QString, QVariant> values = WorkaroundGCCBug() ) { Q_UNUSED(values); } - void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val - = (QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >()) ) - { Q_UNUSED(val); } -#endif void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } -#if defined(Q_MOC_RUN) || (defined(Q_COMPILER_AUTO_TYPE) && !(defined(Q_CC_CLANG) && Q_CC_CLANG < 304)) - // There is no Q_COMPILER_>> but if compiler support auto, it should also support >> - void performSomething(QVector<QList<QString>> e = QVector<QList<QString>>(8 < 1), - QHash<int, QVector<QString>> h = QHash<int, QVector<QString>>()) + void performSomething(QList<QList<QString>> e = QList<QList<QString>>(8 < 1), + QHash<int, QList<QString>> h = QHash<int, QList<QString>>()) { Q_UNUSED(e); Q_UNUSED(h); } -#else - void performSomething(QVector<QList<QString> > e = QVector<QList<QString> >(), - QHash<int, QVector<QString> > h = (QHash<int, QVector<QString> >())) - { Q_UNUSED(e); Q_UNUSED(h); } -#endif }; @@ -1838,7 +1822,7 @@ void tst_Moc::QTBUG12260_defaultTemplate() QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1); QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomethingElse(QSharedPointer<QVarLengthArray<QString,(16>>2)>>)") != -1); - QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QVector<QList<QString>>,QHash<int,QVector<QString>>)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QList<QList<QString>>,QHash<int,QList<QString>>)") != -1); } void tst_Moc::notifyError() |