From 4a2c238a6dfbbdf3bd27a91efc96b747944e767a Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 30 Apr 2010 16:13:30 +1000 Subject: Avoid regenerating PathView delegates needlessly --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 911f5a4..b35d30d 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -795,7 +795,7 @@ void QDeclarativePathView::setInteractive(bool interactive) The number of elements in the delegate has a direct effect on the flicking performance of the view when pathItemCount is specified. If at all possible, place functionality that is not needed for the normal display of the delegate in a \l Loader which - can be created when needed. + can load additional elements when needed. Note that the PathView will layout the items based on the size of the root item in the delegate. @@ -1051,7 +1051,11 @@ void QDeclarativePathView::componentComplete() Q_D(QDeclarativePathView); QDeclarativeItem::componentComplete(); d->createHighlight(); - d->regenerate(); + // It is possible that a refill has already happended to to Path + // bindings being handled in the componentComplete(). If so + // don't do it again. + if (d->items.count() == 0) + d->regenerate(); d->updateHighlight(); } -- cgit v0.12