diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2016-05-03 09:57:24 +0200 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@kdab.com> | 2016-05-03 08:00:30 +0000 |
commit | 373c621bf4dc2ab07bb9c4f19c783fd36debb0dc (patch) | |
tree | 24e30fb67062712d4dae249c56492de712c146e2 /src/qml/jsruntime/qv4sequenceobject.cpp | |
parent | 42fd8ec2495001c1435bbc34017416c18e691bb3 (diff) |
Add QVector support to JS sequences
Change-Id: I731355aa1754721236f3711a65af4f96781cebc0
Task-number: QTBUG-51467
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index b97310c5b9..fa2409a85c 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -75,6 +75,9 @@ static void generateWarning(QV4::ExecutionEngine *v4, const QString& description // F(elementType, elementTypeName, sequenceType, defaultValue) #define FOREACH_QML_SEQUENCE_TYPE(F) \ + F(int, IntVector, QVector<int>, 0) \ + F(qreal, RealVector, QVector<qreal>, 0.0) \ + F(bool, BoolVector, QVector<bool>, false) \ F(int, Int, QList<int>, 0) \ F(qreal, Real, QList<qreal>, 0.0) \ F(bool, Bool, QList<bool>, false) \ @@ -578,6 +581,15 @@ Heap::QQmlSequence<Container>::QQmlSequence(QObject *object, int propertyIndex) namespace QV4 { +typedef QQmlSequence<QVector<int> > QQmlIntVectorList; +template<> +DEFINE_OBJECT_VTABLE(QQmlIntVectorList); +typedef QQmlSequence<QVector<qreal> > QQmlRealVectorList; +template<> +DEFINE_OBJECT_VTABLE(QQmlRealVectorList); +typedef QQmlSequence<QVector<bool> > QQmlBoolVectorList; +template<> +DEFINE_OBJECT_VTABLE(QQmlBoolVectorList); typedef QQmlSequence<QStringList> QQmlQStringList; template<> DEFINE_OBJECT_VTABLE(QQmlQStringList); |