summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcheckbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qcheckbox.cpp')
-rw-r--r--src/widgets/widgets/qcheckbox.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index 9b49916774..235508535d 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -45,6 +45,9 @@
#include "qstyle.h"
#include "qstyleoption.h"
#include "qevent.h"
+#ifndef QT_NO_ACCESSIBILITY
+#include "qaccessible.h"
+#endif
#include "private/qabstractbutton_p.h"
@@ -243,6 +246,9 @@ Qt::CheckState QCheckBox::checkState() const
void QCheckBox::setCheckState(Qt::CheckState state)
{
Q_D(QCheckBox);
+#ifndef QT_NO_ACCESSIBILITY
+ bool noChange = d->noChange;
+#endif
if (state == Qt::PartiallyChecked) {
d->tristate = true;
d->noChange = true;
@@ -257,6 +263,15 @@ void QCheckBox::setCheckState(Qt::CheckState state)
d->publishedState = state;
emit stateChanged(state);
}
+
+#ifndef QT_NO_ACCESSIBILITY
+ if (noChange != d->noChange) {
+ QAccessible::State s;
+ s.checkStateMixed = true;
+ QAccessibleStateChangeEvent event(this, s);
+ QAccessible::updateAccessibility(&event);
+ }
+#endif
}