diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-02-03 06:11:38 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-02-03 06:11:38 (GMT) |
commit | 9c700d5d0981c9f0ffc8be552a0e7305a3692cb2 (patch) | |
tree | c7bf2a99e10641eeaa2be70d28382b0361b4750c /src/declarative/graphicsitems/qmlgraphicsgridview.cpp | |
parent | bacc9a899aaee5e81d74e86fd30d46f4ab537488 (diff) | |
parent | 59865a84484c29bd21bda62e3c55c8d2eb957f28 (diff) | |
download | Qt-9c700d5d0981c9f0ffc8be552a0e7305a3692cb2.zip Qt-9c700d5d0981c9f0ffc8be552a0e7305a3692cb2.tar.gz Qt-9c700d5d0981c9f0ffc8be552a0e7305a3692cb2.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsgridview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsgridview.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 890d3ad..7105300 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -151,7 +151,7 @@ class QmlGraphicsGridViewPrivate : public QmlGraphicsFlickablePrivate public: QmlGraphicsGridViewPrivate() - : model(0), currentItem(0), flow(QmlGraphicsGridView::LeftToRight) + : currentItem(0), flow(QmlGraphicsGridView::LeftToRight) , visiblePos(0), visibleIndex(0) , currentIndex(-1) , cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1) , highlightComponent(0), highlight(0), trackedItem(0) @@ -307,7 +307,7 @@ public: } } - QmlGraphicsVisualModel *model; + QGuard<QmlGraphicsVisualModel> model; QVariant modelVariant; QList<FxGridItem*> visibleItems; QHash<QmlGraphicsItem*,int> unrequestedItems; @@ -350,6 +350,7 @@ void QmlGraphicsGridViewPrivate::init() void QmlGraphicsGridViewPrivate::clear() { + qDebug() << "clearing items" << visibleItems.count(); for (int i = 0; i < visibleItems.count(); ++i) releaseItem(visibleItems.at(i)); visibleItems.clear(); @@ -384,13 +385,16 @@ FxGridItem *QmlGraphicsGridViewPrivate::createItem(int modelIndex) void QmlGraphicsGridViewPrivate::releaseItem(FxGridItem *item) { Q_Q(QmlGraphicsGridView); - if (!item) + if (!item || !model) return; if (trackedItem == item) { QObject::disconnect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged())); QObject::disconnect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged())); trackedItem = 0; } + qDebug() << "release" << item; + qDebug() << " item" << item->item; + qDebug() << " model" << model; if (model->release(item->item) == 0) { // item was not destroyed, and we no longer reference it. unrequestedItems.insert(item->item, model->indexOf(item->item, q)); |