diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-09-01 18:06:11 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-06 05:29:00 +0200 |
commit | 6bd1704c42f564980677682e1d47e91129d94e5c (patch) | |
tree | 961f0457aa73c97df33fa919e2cbd630547cbab2 /src/declarative/util/qdeclarativechangeset.cpp | |
parent | fdc87143eb9eff98938b6a086c3e81432be08e4d (diff) | |
download | qtdeclarative-6bd1704c42f564980677682e1d47e91129d94e5c.tar.gz |
Add support for filtering VisualDataModels.
Add a VisualDataGroup element which items within a VisualDataModel
can be assigned to. Setting the group property of a VisualDataModel
or one of its parts models will filter the items visible within a
view to just items belonging to that group. By default all items
belong to an 'items' group.
The VisualDataModel attached object includes properties indicating
whether a item is a member of a group and its index in the group.
Task-number: QTBUG-21513 QTBUG-21515
Change-Id: If3df6a359a888a6f79923775d2f78076d5e7d2cf
Reviewed-on: http://codereview.qt-project.org/4115
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/util/qdeclarativechangeset.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativechangeset.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativechangeset.cpp b/src/declarative/util/qdeclarativechangeset.cpp index 33757062a1..81cbe3e10a 100644 --- a/src/declarative/util/qdeclarativechangeset.cpp +++ b/src/declarative/util/qdeclarativechangeset.cpp @@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE QDeclarativeChangeSet::QDeclarativeChangeSet() : m_moveCounter(0) + , m_difference(0) { } @@ -53,6 +54,7 @@ QDeclarativeChangeSet::QDeclarativeChangeSet(const QDeclarativeChangeSet &change , m_inserts(changeSet.m_inserts) , m_changes(changeSet.m_changes) , m_moveCounter(changeSet.m_moveCounter) + , m_difference(0) { } @@ -66,6 +68,7 @@ QDeclarativeChangeSet &QDeclarativeChangeSet::operator =(const QDeclarativeChang m_inserts = changeSet.m_inserts; m_changes = changeSet.m_changes; m_moveCounter = changeSet.m_moveCounter; + m_difference = changeSet.m_difference; return *this; } @@ -330,6 +333,7 @@ void QDeclarativeChangeSet::applyRemovals(QVector<Remove> &removals, QVector<Ins } for (; remove != m_removes.end(); ++remove) remove->index -= removeCount; + m_difference -= removeCount; } void QDeclarativeChangeSet::applyInsertions(QVector<Insert> &insertions) @@ -354,6 +358,7 @@ void QDeclarativeChangeSet::applyInsertions(QVector<Insert> &insertions) if (insert == m_inserts.end()) { insert = m_inserts.insert(insert, *iit); ++insert; + insertCount += iit->count; } else { const int offset = index - insert->index; if (offset < 0 || (offset == 0 && (iit->moveId != -1 || insert->moveId != -1))) { @@ -395,6 +400,7 @@ void QDeclarativeChangeSet::applyInsertions(QVector<Insert> &insertions) change->index += insertCount; for (; insert != m_inserts.end(); ++insert) insert->index += insertCount; + m_difference += insertCount; } void QDeclarativeChangeSet::applyChanges(QVector<Change> &changes) |