From 9e9c979affd1ce76a07c6545c25d2851c7964a7c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 22 Oct 2009 15:39:21 +1000 Subject: Attached property docs for GridView --- src/declarative/fx/qfxgridview.cpp | 55 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 6abe88e..68fae6a 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -679,8 +679,6 @@ void QFxGridViewPrivate::updateCurrent(int modelIndex) In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. - - */ QFxGridView::QFxGridView(QFxItem *parent) : QFxFlickable(*(new QFxGridViewPrivate), parent) @@ -698,6 +696,59 @@ QFxGridView::~QFxGridView() } /*! + \qmlattachedproperty bool GridView::isCurrentItem + This attched property is true if this delegate is the current item; otherwise false. + + It is attached to each instance of the delegate. +*/ + +/*! + \qmlattachedproperty GridView GridView::view + This attached property holds the view that manages this delegate instance. + + It is attached to each instance of the delegate. +*/ + +/*! + \qmlattachedproperty bool GridView::delayRemove + This attached property holds whether the delegate may be destroyed. + + It is attached to each instance of the delegate. + + It is sometimes necessary to delay the destruction of an item + until an animation completes. + + The example below ensures that the animation completes before + the item is removed from the grid. + + \code + Component { + id: myDelegate + Item { + id: wrapper + GridView.onRemove: SequentialAnimation { + PropertyAction { target: wrapper.GridView; property: "delayRemove"; value: true } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing: "easeInOutQuad" } + PropertyAction { target: wrapper.GridView; property: "delayRemove"; value: false } + } + } + } + \endcode +*/ + +//XXX change to \qmlattachedsignal when it exists. +/*! + \qmlattachedproperty void GridView::onAdd + This attached handler is called immediately after an item is added to the view. +*/ + +/*! + \qmlattachedproperty void GridView::onRemove + This attached handler is called immediately before an item is removed from the view. +*/ + + +/*! \qmlproperty model GridView::model This property holds the model providing data for the grid. -- cgit v0.12