summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-27 09:58:12 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-20 20:01:33 +0200
commit03326a2fec416405b437089874f6439e937bbada (patch)
tree48d7137c3cd5e6f537e06e97380d3c1e76a56af9 /src/corelib/kernel
parent1a9a4af388477efd9f7008d5c0bb74432c20279d (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 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/kernel/qmetatype.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 6799057080..c20fb5b6e0 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -682,7 +682,7 @@ static void argumentTypesFromString(const char *str, const char *end,
++str;
}
QByteArray argType(begin, str - begin);
- argType.replace("QList<", "QVector<");
+ argType.replace("QVector<", "QList<");
types += QArgumentType(std::move(argType));
}
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 196df677e9..c7e754cb5c 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -232,7 +232,7 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
TypeName = Id,
#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(F) \
- F(QVector) \
+ F(QList) \
F(QQueue) \
F(QStack) \
F(QSet) \
@@ -2014,7 +2014,7 @@ typedef QHash<QString, QVariant> QVariantHash;
#ifdef Q_CLANG_QDOC
class QByteArrayList;
#else
-typedef QVector<QByteArray> QByteArrayList;
+using QByteArrayList = QList<QByteArray>;
#endif
#define Q_DECLARE_METATYPE_TEMPLATE_1ARG(SINGLE_ARG_TEMPLATE) \
@@ -2515,9 +2515,9 @@ public:
}
#endif
- if (skipToken(begin, end, "QList")) {
- // Replace QList by QVector
- appendStr("QVector");
+ if (skipToken(begin, end, "QVector")) {
+ // Replace QVector by QList
+ appendStr("QList");
}
if (skipToken(begin, end, "QPair")) {