QAbstractButton::setChecked() - don't update accessibility if stale
A QPointer is used as a guard for calling setChecked on a stale object. The guard is not checked on accessibility updates. This patch wraps the accessibility update in a guard check. Fixes: QTBUG-112759 Pick-to: 6.5 Change-Id: Ida47c181b7968911c1805dc244b86347e7afe81b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
143d00cc2c
commit
d953bc76bb
@ -613,12 +613,13 @@ void QAbstractButton::setChecked(bool checked)
|
||||
if (guard)
|
||||
d->emitToggled(checked);
|
||||
|
||||
|
||||
#if QT_CONFIG(accessibility)
|
||||
QAccessible::State s;
|
||||
s.checked = true;
|
||||
QAccessibleStateChangeEvent event(this, s);
|
||||
QAccessible::updateAccessibility(&event);
|
||||
if (guard) {
|
||||
QAccessible::State s;
|
||||
s.checked = true;
|
||||
QAccessibleStateChangeEvent event(this, s);
|
||||
QAccessible::updateAccessibility(&event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user