diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-10 16:53:05 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-15 14:22:42 +0100 |
commit | f73e294472906077556e13ca10df185300c2450f (patch) | |
tree | fece290b38c3d3d4b047b90692a296eabc345905 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | 2715d67f53efc916f212022572fa639d7704b43c (diff) | |
download | qtdeclarative-f73e294472906077556e13ca10df185300c2450f.tar.gz |
Remove the qml_sequence_object feature flag
QML sequences are required for named lists of value types. The original
reason for the introduction of this feature was the template code
explosion caused by the way the sequence types were registered in Qt5.
As we register them differently now, the code size overhead should be
smaller. It makes very little sense to switch sequence types off these
days.
[ChangeLog][QtQml][Important Behavior Changes] The qml_sequence_object
feature flag has been removed. Omitting sequences from the QML language
does not make much sense now that we use them for lists of value types.
The original reason to allow it was that the sequence support took up a
lot of space in the binary. This is not the case anymore since 6.0.
Change-Id: I2f1d43cdd29ba63853316b06113cb49ed30aa410
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 34994bd0e6..07f6b15f5c 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -58,11 +58,7 @@ #include <private/qv4identifiertable_p.h> #include <private/qv4lookup_p.h> #include <private/qv4qmlcontext_p.h> - -#if QT_CONFIG(qml_sequence_object) #include <private/qv4sequenceobject_p.h> -#endif - #include <private/qv4objectproto_p.h> #include <private/qv4jsonobject_p.h> #include <private/qv4regexpobject_p.h> @@ -210,7 +206,6 @@ static QV4::ReturnedValue loadProperty(QV4::ExecutionEngine *v4, QObject *object if (const QMetaObject *valueTypeMetaObject = QQmlMetaType::metaObjectForValueType(propMetaType)) return QV4::QQmlValueTypeWrapper::create(v4, object, property.coreIndex(), valueTypeMetaObject, propMetaType); } else { -#if QT_CONFIG(qml_sequence_object) // see if it's a sequence type bool succeeded = false; QV4::ScopedValue retn(scope, QV4::SequencePrototype::newSequence( @@ -218,7 +213,6 @@ static QV4::ReturnedValue loadProperty(QV4::ExecutionEngine *v4, QObject *object !property.isWritable(), &succeeded)); if (succeeded) return retn->asReturnedValue(); -#endif } if (!propMetaType.isValid()) { @@ -1330,7 +1324,6 @@ private: quint32 intValue; bool boolValue; QObject *qobjectPtr; -#if QT_CONFIG(qml_sequence_object) std::vector<int> *stdVectorIntPtr; std::vector<qreal> *stdVectorRealPtr; std::vector<bool> *stdVectorBoolPtr; @@ -1339,7 +1332,6 @@ private: #if QT_CONFIG(qml_itemmodel) std::vector<QModelIndex> *stdVectorQModelIndexPtr; #endif -#endif char allocData[MaxSizeOf7<QVariant, QString, @@ -1556,14 +1548,12 @@ static int MatchScore(const QV4::Value &actual, QMetaType conversionMetaType) } } -#if QT_CONFIG(qml_sequence_object) if (auto sequenceMetaType = SequencePrototype::metaTypeForSequence(obj); sequenceMetaType != -1) { if (sequenceMetaType == conversionType) return 1; else return 10; } -#endif if (obj->as<QV4::QQmlValueTypeWrapper>()) { const QVariant v = obj->engine()->toVariant(actual, QMetaType {}); @@ -1827,7 +1817,6 @@ void *CallArgument::dataPtr() case QVariantWrappedType: return qvariantPtr->data(); default: -#if QT_CONFIG(qml_sequence_object) if (type == qMetaTypeId<std::vector<int>>()) return stdVectorIntPtr; if (type == qMetaTypeId<std::vector<qreal>>()) @@ -1842,7 +1831,6 @@ void *CallArgument::dataPtr() if (type == qMetaTypeId<std::vector<QModelIndex>>()) return stdVectorQModelIndexPtr; #endif -#endif break; } @@ -1902,7 +1890,6 @@ void CallArgument::initAsType(QMetaType metaType) } } -#if QT_CONFIG(qml_sequence_object) template <class T, class M> bool CallArgument::fromContainerValue(const QV4::Value &value, M CallArgument::*member) { @@ -1916,7 +1903,6 @@ bool CallArgument::fromContainerValue(const QV4::Value &value, M CallArgument::* (this->*member) = nullptr; return false; } -#endif bool CallArgument::fromValue( QMetaType metaType, QV4::ExecutionEngine *engine, const QV4::Value &value) @@ -2037,7 +2023,6 @@ bool CallArgument::fromValue( break; } -#if QT_CONFIG(qml_sequence_object) if (type == qMetaTypeId<std::vector<int>>()) { if (fromContainerValue<std::vector<int>>(value, &CallArgument::stdVectorIntPtr)) return true; @@ -2061,7 +2046,6 @@ bool CallArgument::fromValue( } #endif } -#endif break; } |