diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-03 14:43:47 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-11 09:36:59 +0100 |
commit | d2737bdedb6a53f83bab1c1c5606bcfc1df91687 (patch) | |
tree | f9cd94276d5a422675f7bbce3005aa56c31e269a /src/qml/jsruntime/qv4sequenceobject_p.h | |
parent | 1e8206f7e6bd7a37138921520e0ae43d9ec68eb6 (diff) |
QML: Clean up sequence registrations for value types
We want to be able to construct a meaningful list type by surrounding
the internal name of the type with QList<>. Usually this works because
of the way we auto-register sequential containers for types. Only for
the builtins we need to do some special casing. That special casing
should happen in the builtins, not in QtQml, though.
The generic QList<foo> sequence type is implicitly given for any value
type foo these days. There is no need to mention it in .qmltypes.
QtQml retains some extra container declarations that are not straight
QList<foo> for a value type foo. Everything that's registered by the
value type registration anyway is dropped.
We keep the aliases QStringList and QVariantList in the builtins because
they are really common.
Since we now register QVariantList the way it's mandated by the
builtins, we also have to handle it correctly in qv4sequenceobject.cpp.
In particular, we need to append variants as-is rather than poking into
them.
As QStringList is an additional builtin now, we need to teach the type
resolver about it.
Change-Id: I0dfb5b780b27250f36f6886bc4e0926a03c114b4
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject_p.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject_p.h b/src/qml/jsruntime/qv4sequenceobject_p.h index 593a6696fb..38fde91233 100644 --- a/src/qml/jsruntime/qv4sequenceobject_p.h +++ b/src/qml/jsruntime/qv4sequenceobject_p.h @@ -110,16 +110,13 @@ QT_DECLARE_SEQUENTIAL_CONTAINER(QRealStdVectorForeign, std::vector<qreal>, doubl QT_DECLARE_SEQUENTIAL_CONTAINER(QRealListForeign, QList<qreal>, double); #endif +QT_DECLARE_SEQUENTIAL_CONTAINER(QDoubleStdVectorForeign, std::vector<double>, double); +QT_DECLARE_SEQUENTIAL_CONTAINER(QFloatStdVectorForeign, std::vector<float>, float); QT_DECLARE_SEQUENTIAL_CONTAINER(QIntStdVectorForeign, std::vector<int>, int); QT_DECLARE_SEQUENTIAL_CONTAINER(QBoolStdVectorForeign, std::vector<bool>, bool); QT_DECLARE_SEQUENTIAL_CONTAINER(QStringStdVectorForeign, std::vector<QString>, QString); QT_DECLARE_SEQUENTIAL_CONTAINER(QUrlStdVectorForeign, std::vector<QUrl>, QUrl); -QT_DECLARE_SEQUENTIAL_CONTAINER(QIntListForeign, QList<int>, int); -QT_DECLARE_SEQUENTIAL_CONTAINER(QBoolListForeign, QList<bool>, bool); -QT_DECLARE_SEQUENTIAL_CONTAINER(QStringListForeign, QStringList, QString); -QT_DECLARE_SEQUENTIAL_CONTAINER(QUrlListForeign, QList<QUrl>, QUrl); - #if QT_CONFIG(qml_itemmodel) QT_DECLARE_SEQUENTIAL_CONTAINER(QModelIndexListForeign, QModelIndexList, QModelIndex); QT_DECLARE_SEQUENTIAL_CONTAINER(QModelIndexStdVectorForeign, std::vector<QModelIndex>, QModelIndex); |