From 5c40193f8223a8bdefcf694c719396807a83f0ea Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 7 Jan 2014 15:35:20 +0100 Subject: [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 --- src/qml/parser/qqmljsmemorypool_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/parser') diff --git a/src/qml/parser/qqmljsmemorypool_p.h b/src/qml/parser/qqmljsmemorypool_p.h index 820ae8ed71..29103930ad 100644 --- a/src/qml/parser/qqmljsmemorypool_p.h +++ b/src/qml/parser/qqmljsmemorypool_p.h @@ -108,6 +108,8 @@ public: _ptr = _end = 0; } + template _Tp *New() { return new (this->allocate(sizeof(_Tp))) _Tp(); } + private: void *allocate_helper(size_t size) { -- cgit v1.2.3