diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-07 15:35:20 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-10 10:26:43 +0100 |
commit | 5c40193f8223a8bdefcf694c719396807a83f0ea (patch) | |
tree | 626991eb96b9da976cf0ebe6c944012e81effe0b /src/qml/qml/qqmlobjectcreator_p.h | |
parent | b681bd3e4ad20eb558da68ba1a2e2dfddfab9cf1 (diff) |
[new compiler] Add support for implicitly defined components
Use-cases like
itemDelegate: Item { ... }
implicitly define a component without the item-surrounding Component {}, base
on the fact that the property itself is of type QQmlComponent (or derived).
This means we have to synthesize a Component {} object and insert it into
the data structure.
Change-Id: I8992451a5a6732c7fd898eaf83c276dc6a8b7d19
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 92f40648d3..2d776058ca 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -76,16 +76,20 @@ public: bool resolve(); protected: + void findAndRegisterImplicitComponents(const QtQml::QmlObject *obj, int objectIndex); bool collectIdsAndAliases(int objectIndex); bool resolveAliases(); - bool isComponentType(int typeNameIndex) const - { return resolvedTypes.value(typeNameIndex).type == 0; } + QQmlEnginePrivate *enginePrivate; + QQmlJS::MemoryPool *pool; - const QList<QtQml::QmlObject*> &qmlObjects; + QList<QtQml::QmlObject*> *qmlObjects; const int indexOfRootObject; - // indices of objects that are of type QQmlComponent + // indices of the objects that are actually Component {} + QVector<int> componentRoots; + // indices of objects that are the beginning of a new component + // scope. This is sorted and used for binary search. QVector<int> componentBoundaries; int _componentIndex; @@ -93,7 +97,7 @@ protected: QHash<int, int> *_objectIndexToIdInScope; QList<int> _objectsWithAliases; - const QHash<int, QQmlCompiledData::TypeReference> resolvedTypes; + QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes; const QList<QQmlPropertyCache *> propertyCaches; QList<QByteArray> *vmeMetaObjectData; QHash<int, int> *objectIndexToIdForRoot; |