aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativelistcompositor_p.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-09-29 09:58:42 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-12 02:36:56 +0200
commitae623976b8920117e751448e2a65dab174731476 (patch)
tree21c1e44764a77e50f4fc7202d000c0670692bdee /src/declarative/util/qdeclarativelistcompositor_p.h
parent959778a2b750cbc211643929a6e85a8694d72891 (diff)
Allow view items to be preserved.
Do not destroy items that are members of the VisualDataModel persistedItems group when they are released by the view. The create function on VisualDataGroup will return a reference to an instantiated item within that group, any item returned by this function is automatically added to the persistedItems group and can be released by removing it from the group. Uninstantiated items added to the persistedItems group by any other means are not instantiated until requested by a view or create. Task-number: QTBUG-21518 Task-number: QTBUG-20854 Change-Id: I59554711208504c8f20a3ebe783bddab9b21a558 Reviewed-on: http://codereview.qt-project.org/5831 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/util/qdeclarativelistcompositor_p.h')
-rw-r--r--src/declarative/util/qdeclarativelistcompositor_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativelistcompositor_p.h b/src/declarative/util/qdeclarativelistcompositor_p.h
index cd2d9b3f5f..60df819884 100644
--- a/src/declarative/util/qdeclarativelistcompositor_p.h
+++ b/src/declarative/util/qdeclarativelistcompositor_p.h
@@ -65,23 +65,24 @@ QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QDeclarativeListCompositor
{
public:
- enum { MaximumGroupCount = 10 };
+ enum { MaximumGroupCount = 11 };
enum Group
{
Cache = 0,
- Default = 1
+ Default = 1,
+ Persisted = 2
};
enum Flag
{
CacheFlag = 0x000001,
DefaultFlag = 0x000002,
+ PersistedFlag = 0x000004,
GroupMask = 0x00FFFE,
PrependFlag = 0x100000,
AppendFlag = 0x200000,
- MovedFlag = 0x400000,
- RemoveFlags = GroupMask | PrependFlag | AppendFlag
+ MovedFlag = 0x400000
};
class Range
@@ -215,6 +216,7 @@ public:
void setDefaultGroups(int groups) { m_defaultFlags = groups | PrependFlag; }
void setDefaultGroup(Group group) { m_defaultFlags |= (1 << group); }
void clearDefaultGroup(Group group) { m_defaultFlags &= ~(1 << group); }
+ void setRemoveGroups(int groups) { m_removeFlags = PrependFlag | AppendFlag | groups; }
void setGroupCount(int count);
int count(Group group) const;
@@ -272,6 +274,7 @@ private:
iterator m_cacheIt;
int m_groupCount;
int m_defaultFlags;
+ int m_removeFlags;
inline Range *insert(Range *before, void *list, int index, int count, int flags);
inline Range *erase(Range *range);