aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemview_p_p.h
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@rim.com>2013-01-15 14:26:59 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-24 17:14:23 +0100
commit7cad0e52c5a020bd29635e9912fd8946a6b48124 (patch)
tree2f1530f14b8c595d2ad85a229588a988f7f5aba9 /src/quick/items/qquickitemview_p_p.h
parentbbb3d5b403511f6e0bc1966835983b2574596e25 (diff)
Move the model classes from QtQuick to QtQml
This is needed for proper support of non-GUI instantiators in QtQml. Only private C++ classes are affected. Aside from name changes, model classes now operate on QObjects instead of QQuickItems, leading to minor changes in the implementation of QtQuick classes using them. The old QML type names will still be registered in the QtQuick import for the forseeable future, but pointing to the new classes. The new QML types will be added in a second commit. Classes Affected: QQuickVisualDataGroup -> QQmlDataGroup QQuickVisualDataModel -> QQmlDelegateModel QQuickVisualItemModel -> QQmlObjectModel QQuickVisualModel -> QQmlInstanceModel QQuickChangeSet -> QQmlChangeSet QQuickListAccessor -> QQmlListAccessor QQuickListCompositor -> QQmlListCompositor QQuickPackage -> QQuickPackage (just moved for now) Change-Id: Ia19e630e53bfa9e5d459e289596cd11df1ea3930 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/quick/items/qquickitemview_p_p.h')
-rw-r--r--src/quick/items/qquickitemview_p_p.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index 0efc458c3d..af895fb983 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -45,9 +45,9 @@
#include "qquickitemview_p.h"
#include "qquickitemviewtransition_p.h"
#include "qquickflickable_p_p.h"
-#include "qquickvisualdatamodel_p.h"
-#include "qquickvisualitemmodel_p.h"
-#include <private/qquickchangeset_p.h>
+#include <QtQml/private/qqmlobjectmodel_p.h>
+#include <QtQml/private/qqmldelegatemodel_p.h>
+#include <QtQml/private/qqmlchangeset_p.h>
QT_BEGIN_HEADER
@@ -103,14 +103,14 @@ public:
void prepare(int currentIndex, int count);
void reset();
- void applyChanges(const QQuickChangeSet &changeSet);
+ void applyChanges(const QQmlChangeSet &changeSet);
void applyBufferedChanges(const QQuickItemViewChangeSet &other);
int itemCount;
int newCurrentIndex;
- QQuickChangeSet pendingChanges;
- QHash<QQuickChangeSet::MoveKey, FxViewItem *> removedItems;
+ QQmlChangeSet pendingChanges;
+ QHash<QQmlChangeSet::MoveKey, FxViewItem *> removedItems;
bool active : 1;
bool currentChanged : 1;
@@ -209,18 +209,18 @@ public:
void applyPendingChanges();
bool applyModelChanges(ChangeResult *insertionResult, ChangeResult *removalResult);
- bool applyRemovalChange(const QQuickChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount);
- void removeItem(FxViewItem *item, const QQuickChangeSet::Remove &removal, ChangeResult *removeResult);
+ bool applyRemovalChange(const QQmlChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount);
+ void removeItem(FxViewItem *item, const QQmlChangeSet::Remove &removal, ChangeResult *removeResult);
void repositionFirstItem(FxViewItem *prevVisibleItemsFirst, qreal prevVisibleItemsFirstPos,
FxViewItem *prevFirstVisible, ChangeResult *insertionResult, ChangeResult *removalResult);
void createTransitioner();
void prepareVisibleItemTransitions();
- void prepareRemoveTransitions(QHash<QQuickChangeSet::MoveKey, FxViewItem *> *removedItems);
+ void prepareRemoveTransitions(QHash<QQmlChangeSet::MoveKey, FxViewItem *> *removedItems);
bool prepareNonVisibleItemTransition(FxViewItem *item, const QRectF &viewBounds);
virtual void viewItemTransitionFinished(QQuickItemViewTransitionableItem *item);
- int findMoveKeyIndex(QQuickChangeSet::MoveKey key, const QVector<QQuickChangeSet::Remove> &changes) const;
+ int findMoveKeyIndex(QQmlChangeSet::MoveKey key, const QVector<QQmlChangeSet::Remove> &changes) const;
void checkVisible() const;
void showVisibleItems() const;
@@ -251,7 +251,7 @@ public:
q->polish();
}
- QQmlGuard<QQuickVisualModel> model;
+ QQmlGuard<QQmlInstanceModel> model;
QVariant modelVariant;
int itemCount;
int buffer;
@@ -286,8 +286,8 @@ public:
struct MovedItem {
FxViewItem *item;
- QQuickChangeSet::MoveKey moveKey;
- MovedItem(FxViewItem *i, QQuickChangeSet::MoveKey k)
+ QQmlChangeSet::MoveKey moveKey;
+ MovedItem(FxViewItem *i, QQmlChangeSet::MoveKey k)
: item(i), moveKey(k) {}
};
QQuickItemViewTransitioner *transitioner;
@@ -309,6 +309,7 @@ public:
bool fillCacheBuffer : 1;
bool inRequest : 1;
bool runDelayedRemoveTransition : 1;
+ bool delegateValidated : 1;
protected:
virtual Qt::Orientation layoutOrientation() const = 0;
@@ -346,7 +347,7 @@ protected:
virtual void layoutVisibleItems(int fromModelIndex = 0) = 0;
virtual void changedVisibleIndex(int newIndex) = 0;
- virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult,
+ virtual bool applyInsertionChange(const QQmlChangeSet::Insert &insert, ChangeResult *changeResult,
QList<FxViewItem *> *newItems, QList<MovedItem> *movingIntoView) = 0;
virtual bool needsRefillForAddedOrRemovedIndex(int) const { return false; }