diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2012-03-07 13:51:31 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-12 13:14:05 +0100 |
commit | eb57da5b3ff9915d2254fdbf57992fa0320d9041 (patch) | |
tree | 47c862ddba23eaa4790eb2f7e8d10e1c5299da11 /src/widgets/widgets | |
parent | 0ecec0e903f80c8657f323a51973b81cdeebcac1 (diff) |
Update accessibility StateChange by custom event.
Subclass QAccessibleEvent to give details what changed in the
state change.
Change-Id: I9005d311e85a3c8bfa6e062833fa6a8a7dc6a4a4
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qabstractbutton.cpp | 10 | ||||
-rw-r--r-- | src/widgets/widgets/qpushbutton.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index f7c8ad7773..aebef8ddc9 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -504,9 +504,6 @@ void QAbstractButtonPrivate::refresh() if (blockRefresh) return; q->update(); -#ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::StateChanged, q, 0)); -#endif } void QAbstractButtonPrivate::click() @@ -767,6 +764,13 @@ void QAbstractButton::setChecked(bool checked) d->notifyChecked(); if (guard) emit toggled(checked); + + +#ifndef QT_NO_ACCESSIBILITY + QAccessible::State s; + s.checked = true; + QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this)); +#endif } bool QAbstractButton::isChecked() const diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 7ca5dcb486..059b0f801c 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -376,7 +376,9 @@ void QPushButton::setDefault(bool enable) } update(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::StateChanged, this, 0)); + QAccessible::State s; + s.defaultButton = true; + QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this)); #endif } |