aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-25 10:50:14 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-25 10:50:15 +0200
commite1a6475a2a3ea46b2afbc2f154c18b255466dad7 (patch)
tree6e400e8def7a391c05d9b6ce174f1f6490544d18 /src/quicktemplates2/qquickscrollbar.cpp
parentb09cf7966fdf8a6949acd912cfb054556d155ee8 (diff)
parent5ca18a3f21083151b771f0efa2a2605f183c8166 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/quicktemplates2/qquickscrollbar.cpp')
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index 52daa27f..535151d6 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -40,6 +40,9 @@
#include <QtQml/qqmlinfo.h>
#include <QtQuick/private/qquickflickable_p.h>
+#if QT_CONFIG(accessibility)
+#include <QtQuick/private/qquickaccessibleattached_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -724,8 +727,19 @@ void QQuickScrollBar::accessibilityActiveChanged(bool active)
QQuickControl::accessibilityActiveChanged(active);
Q_D(QQuickScrollBar);
- if (active)
+ if (active) {
setAccessibleProperty("pressed", d->pressed);
+
+ if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this)) {
+ connect(accessibleAttached, &QQuickAccessibleAttached::increaseAction, this, &QQuickScrollBar::increase);
+ connect(accessibleAttached, &QQuickAccessibleAttached::decreaseAction, this, &QQuickScrollBar::decrease);
+ }
+ } else {
+ if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this)) {
+ disconnect(accessibleAttached, &QQuickAccessibleAttached::increaseAction, this, &QQuickScrollBar::increase);
+ disconnect(accessibleAttached, &QQuickAccessibleAttached::decreaseAction, this, &QQuickScrollBar::decrease);
+ }
+ }
}
QAccessible::Role QQuickScrollBar::accessibleRole() const