From 703c808a5649169dd6b9605af273374cd62951d1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 5 Sep 2011 17:31:41 +1000 Subject: Asynchronous component instantiation This introduces two main: * the QML compiler executes in a separate thread * item instantiation can be interrupted and resumed to allow it to be split across multiple frames. Task-number: QTBUG-21151 Change-Id: I9631c62bb77da3a2e0c37f0da3719533fdce4fef Reviewed-on: http://codereview.qt-project.org/5676 Reviewed-by: Martin Jones --- src/declarative/qml/ftw/qfieldlist_p.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/declarative/qml/ftw/qfieldlist_p.h') diff --git a/src/declarative/qml/ftw/qfieldlist_p.h b/src/declarative/qml/ftw/qfieldlist_p.h index ff6b89b96f..f0efd16a20 100644 --- a/src/declarative/qml/ftw/qfieldlist_p.h +++ b/src/declarative/qml/ftw/qfieldlist_p.h @@ -61,6 +61,8 @@ class QFieldList public: inline QFieldList(); inline N *first() const; + inline N *takeFirst(); + inline void append(N *); inline void prepend(N *); @@ -73,6 +75,8 @@ public: inline void prepend(QFieldList &); inline void insertAfter(N *, QFieldList &); + inline void copyAndClear(QFieldList &); + static inline N *next(N *v); private: @@ -93,6 +97,21 @@ N *QFieldList::first() const return _first; } +template +N *QFieldList::takeFirst() +{ + N *value = _first; + if (value) { + _first = next(value); + if (_last == value) { + Q_ASSERT(_first == 0); + _last = 0; + } + --_count; + } + return value; +} + template void QFieldList::append(N *v) { @@ -207,4 +226,14 @@ void QFieldList::insertAfter(N *after, QFieldList } } +template +void QFieldList::copyAndClear(QFieldList &o) +{ + _first = o._first; + _last = o._last; + _count = o._count; + o._first = o._last = 0; + o._count = 0; +} + #endif // QFIELDLIST_P_H -- cgit v1.2.3