From e9b3c429337a3ddc144aa1f39d40cd8dd151a566 Mon Sep 17 00:00:00 2001 From: peterpa Date: Thu, 25 Aug 2011 15:04:48 +0200 Subject: QWindowsStyle: fix bug in eventFilter on KeyPressed event with alt pressed: incorrect work with list Merge-request: 2664 Reviewed-by: Frederik Gladhorn --- src/gui/styles/qwindowsstyle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index c099273..9732c7e 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -177,11 +177,14 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) // Alt has been pressed - find all widgets that care QList l = widget->findChildren(); - for (int pos=0 ; pos < l.size() ; ++pos) { + for (int pos=0 ; pos < l.size() ;) { QWidget *w = l.at(pos); if (w->isWindow() || !w->isVisible() || - w->style()->styleHint(SH_UnderlineShortcut, 0, w)) + w->style()->styleHint(SH_UnderlineShortcut, 0, w)) { l.removeAt(pos); + continue; + } + pos++; } // Update states before repainting d->seenAlt.append(widget); -- cgit v0.12 From 1dd59e4cf52b189d6ddf9fe7ff46a30e64e5a2ac Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 26 Aug 2011 10:33:20 +0200 Subject: Check if bridge plugin vector is still valid. Q_GLOBAL_STATIC may be destroyed and we still send ObjectDestroyed notifications. This only shows now that we actually send the Destroyed notifications. --- src/gui/accessible/qaccessible_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/accessible/qaccessible_unix.cpp b/src/gui/accessible/qaccessible_unix.cpp index 19fbe78..1c1eb2a 100644 --- a/src/gui/accessible/qaccessible_unix.cpp +++ b/src/gui/accessible/qaccessible_unix.cpp @@ -96,7 +96,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason) } initialize(); - if (bridges()->isEmpty()) + if (!bridges() || bridges()->isEmpty()) return; QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); -- cgit v0.12