diff options
author | Nils Jeisecke <jeisecke@saltation.de> | 2013-10-07 11:55:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-26 09:19:23 +0100 |
commit | 1061c7e5cfae88a336f1327cc20b2d8a0a3c6015 (patch) | |
tree | 058e8a07c1da7671ac8fcd9c91b91b386d106a2e /src/quick/items/qquickitemview.cpp | |
parent | 7d25db8ff452926e58b7a66608666b35c194fc69 (diff) |
Make GridView/ListView attached "view" property available to all delegate types
This is useful for accessing the view (e.g. "width", "cellWidth", ... properties)
from within section (ListView only), header, footer and highlight delegate components.
A typical usecase are components that are used in multiple views and therefore
cannot use the views's id for access.
The only attached property valid for those non-item delegates is "view". This
has been added to the documentation.
Change-Id: I33d976da778be23ed531a3b193ceee95ed9800d2
Task-number: QTBUG-32836
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickitemview.cpp')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 30d0619f7a..020d48613b 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -51,15 +51,17 @@ QT_BEGIN_NAMESPACE #define QML_VIEW_DEFAULTCACHEBUFFER 320 #endif -FxViewItem::FxViewItem(QQuickItem *i, QQuickItemView *v, bool own) +FxViewItem::FxViewItem(QQuickItem *i, QQuickItemView *v, bool own, QQuickItemViewAttached *attached) : item(i) , view(v) , transitionableItem(0) - , attached(0) + , attached(attached) , ownItem(own) , releaseAfterTransition(false) , trackGeom(false) { + if (attached) // can be null for default components (see createComponentItem) + attached->setView(view); } FxViewItem::~FxViewItem() |