aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickabstractbutton.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-10-24 23:27:44 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-10-25 08:45:21 +0000
commit2de38813d72ff243459897aea2b2596287e4e1d3 (patch)
treedd4deccf587019e9986677a549cfacc20d543cc0 /src/quicktemplates2/qquickabstractbutton.cpp
parentbd4f5a04969b2e69a56c9f735e9376e89ef83690 (diff)
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 <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton.cpp')
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp10
1 files changed, 9 insertions, 1 deletions
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();
}
/*!