#define QML_FLICK_SNAPONETHRESHOLD 30
#endif
-//#define DEBUG_DELEGATE_LIFECYCLE
-
//----------------------------------------------------------------------------
class FxGridItemSG : public FxViewItem
bool changed = false;
while (modelIndex < model->count() && rowPos <= fillTo + rowSize()*(columns - colNum)/(columns+1)) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: append item" << modelIndex << colPos << rowPos;
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: append item" << modelIndex << colPos << rowPos;
if (!(item = static_cast<FxGridItemSG*>(createItem(modelIndex, doBuffer))))
break;
if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
// Prepend
colPos = colNum * colSize();
while (visibleIndex > 0 && rowPos + rowSize() - 1 >= fillFrom - rowSize()*(colNum+1)/(columns+1)){
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
if (!(item = static_cast<FxGridItemSG*>(createItem(visibleIndex-1, doBuffer))))
break;
--visibleIndex;
&& item->rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
if (item->attached->delayRemove())
break;
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
if (item->index != -1)
visibleIndex++;
visibleItems.removeFirst();
if (item->transitionScheduledOrRunning()) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "\tnot releasing animating item:" << item->index << item->item->objectName();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item:" << item->index << item->item->objectName();
item->releaseAfterTransition = true;
releasePendingTransition.append(item);
} else {
&& item->rowPos() > bufferTo + rowSize()*(columns - item->colPos()/colSize())/(columns+1)) {
if (item->attached->delayRemove())
break;
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: remove last" << visibleIndex+visibleItems.count()-1;
visibleItems.removeLast();
if (item->transitionScheduledOrRunning()) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "\tnot releasing animating item:" << item->index << item->item->objectName();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item:" << item->index << item->item->objectName();
item->releaseAfterTransition = true;
releasePendingTransition.append(item);
} else {
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcItemViewDelegateLifecycle, "qt.quick.itemview.lifecycle")
+
// Default cacheBuffer for all views.
#ifndef QML_VIEW_DEFAULTCACHEBUFFER
#define QML_VIEW_DEFAULTCACHEBUFFER 320
#include "qquickflickable_p.h"
#include <qpointer.h>
+#include <QtCore/QLoggingCategory>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcItemViewDelegateLifecycle)
+
class QQmlChangeSet;
class QQuickItemViewPrivate;
#define QML_FLICK_SNAPONETHRESHOLD 30
#endif
-//#define DEBUG_DELEGATE_LIFECYCLE
-
class FxListItemSG;
class QQuickListViewPrivate : public QQuickItemViewPrivate
FxListItemSG *item = 0;
qreal pos = itemEnd;
while (modelIndex < model->count() && pos <= fillTo) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer;
-#endif
if (!(item = static_cast<FxListItemSG*>(createItem(modelIndex, doBuffer))))
break;
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: append item" << modelIndex << "pos" << pos << "buffer" << doBuffer << "item" << item->item->objectName();
if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
item->setPosition(pos, true);
QQuickItemPrivate::get(item->item)->setCulled(doBuffer);
return changed;
while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > fillFrom) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos << "buffer" << doBuffer;
-#endif
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();
--visibleIndex;
visiblePos -= item->size() + spacing;
if (!transitioner || !transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) // pos will be set by layoutVisibleItems()
break;
if (item->size() > 0) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
// remove this item and all zero-sized items before it
while (item) {
if (item->index != -1)
visibleIndex++;
visibleItems.removeAt(index);
if (item->transitionScheduledOrRunning()) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill not releasing animating item" << item->index << item->item->objectName();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << item->item->objectName();
item->releaseAfterTransition = true;
releasePendingTransition.append(item);
} else {
while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) {
if (item->attached->delayRemove())
break;
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position() << item->item->objectName();
visibleItems.removeLast();
if (item->transitionScheduledOrRunning()) {
-#ifdef DEBUG_DELEGATE_LIFECYCLE
- qDebug() << "refill not releasing animating item" << item->index << item->item->objectName();
-#endif
+ qCDebug(lcItemViewDelegateLifecycle) << "\tnot releasing animating item" << item->index << item->item->objectName();
item->releaseAfterTransition = true;
releasePendingTransition.append(item);
} else {