summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-04-12 08:15:46 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-17 23:16:51 +0200
commit84e782e2bd93f97bd1f4f46853462e794ce374b2 (patch)
tree1caf0210a8428ae633627339bb73ba0a1101c4c5 /src/widgets
parentc65a558e00da57303d4eeb817f034e4037543aa3 (diff)
Only send progress bar updates when visible.
Screen readers tend to announce progress. Some applications (for example KMail) have hidden progress bars that update frequently. While the applications should be fixed, it's better not to spam the user with continous progress announcements. Ported from Qt 4 patch. Change-Id: I5f3b5a83dc80594d995b10e58527115de8601c77 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> (cherry picked from commit 90dc28900d3abfb00a65fef1d9daf36e727dfdca)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qprogressbar.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index c02aa0e875..33c61796ea 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -314,8 +314,10 @@ void QProgressBar::setValue(int value)
d->value = value;
emit valueChanged(value);
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleValueChangeEvent event(this, value);
- QAccessible::updateAccessibility(&event);
+ if (isVisible()) {
+ QAccessibleValueChangeEvent event(this, value);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
if (d->repaintRequired())
repaint();