From 2de38813d72ff243459897aea2b2596287e4e1d3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 24 Oct 2017 23:27:44 +0200 Subject: QQuickButton: promote autoRepeat back to QQuickAbstractButton The original reason why autoRepeat was demoted to QQuickButton was that some subclasses, such as QQuickCheckBox, did not need this property. The same was done with the checkable property. It was first demoted, and then promoted back to QQuickAbstractButton. These can be useful for building custom AbstractButton-based controls. Now that we want to make auto-repeat configurable (autoRepeatInterval and autoRepeatDelay), and the logic has to be in the base class anyway, it makes more sense to expose all these in the base class instead of doing the property hiding tricks for all three properties. [ChangeLog][Controls][AbstractButton] The autoRepeat property was promoted from Button to AbstractButton. Change-Id: Ife105da00d7d87a74fc8160ec35762b6f71d3ad9 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickabstractbutton.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquickabstractbutton.cpp') diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index 2100dce2..44d1da25 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -630,6 +630,14 @@ void QQuickAbstractButton::setAutoExclusive(bool exclusive) emit autoExclusiveChanged(); } +/*! + \qmlproperty bool QtQuick.Controls::AbstractButton::autoRepeat + + This property holds whether the button repeats \l pressed(), \l released() + and \l clicked() signals while the button is pressed and held down. + + The default value is \c false. +*/ bool QQuickAbstractButton::autoRepeat() const { Q_D(const QQuickAbstractButton); @@ -644,7 +652,7 @@ void QQuickAbstractButton::setAutoRepeat(bool repeat) d->stopPressRepeat(); d->autoRepeat = repeat; - buttonChange(ButtonAutoRepeatChange); + emit autoRepeatChanged(); } /*! -- cgit v1.2.3