diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-03-09 11:02:03 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-13 02:02:49 +0100 |
commit | c4e25d2cf6fe49277a37e183504990535242037f (patch) | |
tree | fd2d947bbd02ef26b643c2fb2e3ada2230660348 /src/quick/util | |
parent | be8675ab01132ffb03b81cc81842775d6a8fa3f9 (diff) |
Declare change set and compositor structs as movable primative types.
Allows QVector to avoid invoking contructors for these types
unnecessarily.
Change-Id: Icc8670e4a033c943666f907c7e1b006a3d205597
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickchangeset_p.h | 5 | ||||
-rw-r--r-- | src/quick/util/qquicklistcompositor_p.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/quick/util/qquickchangeset_p.h b/src/quick/util/qquickchangeset_p.h index 64179666c7..04a1e77c24 100644 --- a/src/quick/util/qquickchangeset_p.h +++ b/src/quick/util/qquickchangeset_p.h @@ -152,6 +152,11 @@ private: int m_difference; }; +Q_DECLARE_TYPEINFO(QQuickChangeSet::Change, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QQuickChangeSet::Remove, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QQuickChangeSet::Insert, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QQuickChangeSet::MoveKey, Q_PRIMITIVE_TYPE); + inline uint qHash(const QQuickChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); } inline bool operator ==(const QQuickChangeSet::MoveKey &l, const QQuickChangeSet::MoveKey &r) { return l.moveId == r.moveId && l.offset == r.offset; } diff --git a/src/quick/util/qquicklistcompositor_p.h b/src/quick/util/qquicklistcompositor_p.h index b12ee8025f..5c9d679fa4 100644 --- a/src/quick/util/qquicklistcompositor_p.h +++ b/src/quick/util/qquicklistcompositor_p.h @@ -317,6 +317,10 @@ private: friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor &list); }; +Q_DECLARE_TYPEINFO(QQuickListCompositor::Change, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QQuickListCompositor::Remove, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QQuickListCompositor::Insert, Q_PRIMITIVE_TYPE); + inline QQuickListCompositor::iterator::iterator() : range(0), offset(0), group(Default), groupCount(0) {} inline QQuickListCompositor::iterator::iterator(const iterator &it) |