aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktumbler.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-04-25 06:18:25 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-04-25 07:19:57 +0000
commit05d05d8bb2e947faede6f6960c2bfea40a5e610e (patch)
treebc7ca4eb1325c1dc68171f93dea262376e473358 /src/quicktemplates2/qquicktumbler.cpp
parentf2ede1a01237c0ff0285716359a8b57a6676a94d (diff)
Doc: add missing Tumbler attached properties
Change-Id: I998d60a303541b3cb6ebeb5d16861cdb08275135 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/quicktemplates2/qquicktumbler.cpp')
-rw-r--r--src/quicktemplates2/qquicktumbler.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp
index bd9f106f..546e699c 100644
--- a/src/quicktemplates2/qquicktumbler.cpp
+++ b/src/quicktemplates2/qquicktumbler.cpp
@@ -529,12 +529,37 @@ QQuickTumblerAttached::~QQuickTumblerAttached()
{
}
+/*!
+ \qmlattachedproperty Tumbler QtQuick.Controls::Tumbler::tumbler
+ \readonly
+
+ This attached property holds the tumbler. The property can be attached to
+ a tumbler delegate. The value is \c null if the item is not a tumbler delegate.
+*/
QQuickTumbler *QQuickTumblerAttached::tumbler() const
{
Q_D(const QQuickTumblerAttached);
return d->tumbler;
}
+/*!
+ \qmlattachedproperty real QtQuick.Controls::Tumbler::displacement
+ \readonly
+
+ This attached property holds a value from \c {-visibleItemCount / 2} to
+ \c {visibleItemCount / 2}, which represents how far away this item is from
+ being the current item, with \c 0 being completely current.
+
+ For example, the item below will be 40% opaque when it is not the current item,
+ and transition to 100% opacity when it becomes the current item:
+
+ \code
+ delegate: Text {
+ text: modelData
+ opacity: 0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6
+ }
+ \endcode
+*/
qreal QQuickTumblerAttached::displacement() const
{
Q_D(const QQuickTumblerAttached);