ListView: more robust output in debug message
authorLiang Qi <liang.qi@theqtcompany.com>
Thu, 25 Jun 2015 12:43:27 +0000 (14:43 +0200)
committerLiang Qi <liang.qi@theqtcompany.com>
Mon, 29 Jun 2015 22:55:16 +0000 (22:55 +0000)
Contains essentially the same information, but allows the
item pointer to be null.

Change-Id: Ib848e0050c895facfbf13bddc6fec12df37a66ff
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
src/quick/items/qquicklistview.cpp

index c0287168f39923df9d96cacba85ab4d86c33af25..c14419dbeea1c4db5ae863645f0541371a065ce5 100644 (file)
@@ -667,7 +667,7 @@ bool QQuickListViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, qreal
     while (modelIndex < model->count() && pos <= fillTo) {
         if (!(item = static_cast<FxListItemSG*>(createItem(modelIndex, doBuffer))))
             break;
-        qCDebug(lcItemViewDelegateLifecycle) << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer << "item" << item->item->objectName();
+        qCDebug(lcItemViewDelegateLifecycle) << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
         if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
             item->setPosition(pos, true);
         if (item->item)
@@ -684,7 +684,7 @@ bool QQuickListViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, qreal
     while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > fillFrom) {
         if (!(item = static_cast<FxListItemSG*>(createItem(visibleIndex-1, doBuffer))))
             break;
-        qCDebug(lcItemViewDelegateLifecycle) << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos << "buffer" << doBuffer << "item" << item->item->objectName();
+        qCDebug(lcItemViewDelegateLifecycle) << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos << "buffer" << doBuffer << "item" << (QObject *)(item->item);
         --visibleIndex;
         visiblePos -= item->size() + spacing;
         if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
@@ -721,7 +721,7 @@ bool QQuickListViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal buffer
                     visibleIndex++;
                 visibleItems.removeAt(index);
                 if (item->transitionScheduledOrRunning()) {
-                    qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << item->item->objectName();
+                    qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << (QObject *)(item->item);
                     item->releaseAfterTransition = true;
                     releasePendingTransition.append(item);
                 } else {
@@ -740,10 +740,10 @@ bool QQuickListViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal buffer
     while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) {
         if (item->attached->delayRemove())
             break;
-        qCDebug(lcItemViewDelegateLifecycle) << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position() << item->item->objectName();
+        qCDebug(lcItemViewDelegateLifecycle) << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position() << (QObject *)(item->item);
         visibleItems.removeLast();
         if (item->transitionScheduledOrRunning()) {
-            qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << item->item->objectName();
+            qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << (QObject *)(item->item);
             item->releaseAfterTransition = true;
             releasePendingTransition.append(item);
         } else {