aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/ftw/qfieldlist_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-09-05 17:31:41 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-29 06:12:49 +0200
commit703c808a5649169dd6b9605af273374cd62951d1 (patch)
tree7248cc72bfa632a51c814d6622f0b12a7f2bd443 /src/declarative/qml/ftw/qfieldlist_p.h
parent600e56ad053362dd5d4150f5dec6b93c2fee575b (diff)
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 <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/qml/ftw/qfieldlist_p.h')
-rw-r--r--src/declarative/qml/ftw/qfieldlist_p.h29
1 files changed, 29 insertions, 0 deletions
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<N, nextMember> &);
inline void insertAfter(N *, QFieldList<N, nextMember> &);
+ inline void copyAndClear(QFieldList<N, nextMember> &);
+
static inline N *next(N *v);
private:
@@ -94,6 +98,21 @@ N *QFieldList<N, nextMember>::first() const
}
template<class N, N *N::*nextMember>
+N *QFieldList<N, nextMember>::takeFirst()
+{
+ N *value = _first;
+ if (value) {
+ _first = next(value);
+ if (_last == value) {
+ Q_ASSERT(_first == 0);
+ _last = 0;
+ }
+ --_count;
+ }
+ return value;
+}
+
+template<class N, N *N::*nextMember>
void QFieldList<N, nextMember>::append(N *v)
{
Q_ASSERT(v->*nextMember == 0);
@@ -207,4 +226,14 @@ void QFieldList<N, nextMember>::insertAfter(N *after, QFieldList<N, nextMember>
}
}
+template<class N, N *N::*nextMember>
+void QFieldList<N, nextMember>::copyAndClear(QFieldList<N, nextMember> &o)
+{
+ _first = o._first;
+ _last = o._last;
+ _count = o._count;
+ o._first = o._last = 0;
+ o._count = 0;
+}
+
#endif // QFIELDLIST_P_H