diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-04 17:48:29 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-05 12:07:24 +0000 |
commit | ae3e7f0799fcdd094e54d792e1a9b13c0e7730aa (patch) | |
tree | 17883a4bb4b164283d5678cb9024612548f6870d /src/quicktemplates2/qquicktumbler.cpp | |
parent | 19c3993abd691843194cce6c047773acc21c2523 (diff) |
Add QQuickTumbler::moving
[ChangeLog][Controls][Tumbler] Added a moving-property that describes
whether the tumbler is currently moving, due to the user either
dragging or flicking the tumbler.
Change-Id: Ic86d243cdbdfa8fcd7a7932264332c04a16e020a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktumbler.cpp')
-rw-r--r-- | src/quicktemplates2/qquicktumbler.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp index b7e47ec8..8d0aa4d4 100644 --- a/src/quicktemplates2/qquicktumbler.cpp +++ b/src/quicktemplates2/qquicktumbler.cpp @@ -439,6 +439,19 @@ void QQuickTumbler::resetWrap() d->setWrapBasedOnCount(); } +/*! + \qmlproperty bool QtQuick.Controls::Tumbler::moving + \since QtQuick.Controls 2.2 + + This property describes whether the tumbler is currently moving, due to + the user either dragging or flicking it. +*/ +bool QQuickTumbler::isMoving() const +{ + Q_D(const QQuickTumbler); + return d->view && d->view->property("moving").toBool(); +} + QQuickTumblerAttached *QQuickTumbler::qmlAttachedProperties(QObject *object) { return new QQuickTumblerAttached(object); @@ -505,6 +518,7 @@ void QQuickTumblerPrivate::disconnectFromView() QObject::disconnect(view, SIGNAL(currentIndexChanged()), q, SLOT(_q_onViewCurrentIndexChanged())); QObject::disconnect(view, SIGNAL(currentItemChanged()), q, SIGNAL(currentItemChanged())); QObject::disconnect(view, SIGNAL(countChanged()), q, SLOT(_q_onViewCountChanged())); + QObject::disconnect(view, SIGNAL(movingChanged()), q, SIGNAL(movingChanged())); QQuickItemPrivate *oldViewContentItemPrivate = QQuickItemPrivate::get(viewContentItem); oldViewContentItemPrivate->removeItemChangeListener(this, QQuickItemPrivate::Children); @@ -529,6 +543,7 @@ void QQuickTumblerPrivate::setupViewData(QQuickItem *newControlContentItem) QObject::connect(view, SIGNAL(currentIndexChanged()), q, SLOT(_q_onViewCurrentIndexChanged())); QObject::connect(view, SIGNAL(currentItemChanged()), q, SIGNAL(currentItemChanged())); QObject::connect(view, SIGNAL(countChanged()), q, SLOT(_q_onViewCountChanged())); + QObject::connect(view, SIGNAL(movingChanged()), q, SIGNAL(movingChanged())); QQuickItemPrivate *viewContentItemPrivate = QQuickItemPrivate::get(viewContentItem); viewContentItemPrivate->addItemChangeListener(this, QQuickItemPrivate::Children); |