aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compiler_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-06-30 10:14:17 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-07-06 21:29:39 +0200
commitca27c051ab52b764df8c8aab9c33211cbf94eba1 (patch)
treef2215f58c940585ffa7dc00d11e4a61dc458711b /src/qml/compiler/qv4compiler_p.h
parent984f774ca9949c096bc3b9d04122c6c5014750a4 (diff)
QmlCompiler: Allow creation of structured value types
With this change, qmlcachegen can populate structured value types from object literals. Also fix the construction of value types via Q_INVOKABLE ctors. We don't need to wrap the ctor argument in QVariant if we can store the original type, and we should always look at the base type for the creatable flag, not the extension. Task-number: QTBUG-107469 Task-number: QTBUG-112485 Change-Id: I9f3db13f00466dc9d87237bdf0b380d6eeb58a10 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler_p.h')
-rw-r--r--src/qml/compiler/qv4compiler_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler_p.h b/src/qml/compiler/qv4compiler_p.h
index 82afb7cf3a..3b90f66a54 100644
--- a/src/qml/compiler/qv4compiler_p.h
+++ b/src/qml/compiler/qv4compiler_p.h
@@ -100,6 +100,8 @@ struct Q_QML_COMPILER_PRIVATE_EXPORT JSUnitGenerator {
ReturnedValue constant(int idx) const;
int registerJSClass(const QStringList &members);
+ int jsClassSize(int jsClassId) const;
+ QString jsClassMember(int jsClassId, int member) const;
int registerTranslation(const CompiledData::TranslationData &translation);
@@ -116,6 +118,7 @@ struct Q_QML_COMPILER_PRIVATE_EXPORT JSUnitGenerator {
StringTableGenerator stringTable;
QString codeGeneratorName;
+
private:
CompiledData::Unit generateHeader(GeneratorOption option, quint32_le *functionOffsets, uint *jsClassDataOffset);