summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-10 16:39:05 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-11 20:08:50 +0100
commit50d0f57b77b8088875d7185c5906b5f57985d5fb (patch)
tree16d21bb5f558461511258f493159658ccecc696a /src/widgets/accessible
parent713282dfe41fbad1c1c940cec54227cd7c267831 (diff)
parent45dc347a95fd674cefcf5d1ac63b01557fcb2fef (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp9
-rw-r--r--src/widgets/accessible/widgets.pro10
2 files changed, 13 insertions, 6 deletions
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index d0627f31a7..3bfef49965 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -39,6 +39,7 @@
#include "qaccessiblewidgets_p.h"
#include "qaccessiblemenu_p.h"
+#include "private/qwidget_p.h"
#include "simplewidgets_p.h"
#include "rangecontrols_p.h"
#include "complexwidgets_p.h"
@@ -59,7 +60,15 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
QAccessibleInterface *iface = 0;
if (!object || !object->isWidgetType())
return iface;
+
QWidget *widget = static_cast<QWidget*>(object);
+ // QWidget emits destroyed() from its destructor instead of letting the QObject
+ // destructor do it, which means the QWidget is unregistered from the accessibillity
+ // cache. But QWidget destruction also emits enter and leave events, which may end
+ // up here, so we have to ensure that we don't fill the cache with an entry of
+ // a widget that is going away.
+ if (QWidgetPrivate::get(widget)->data.in_destructor)
+ return iface;
if (false) {
#ifndef QT_NO_LINEEDIT
diff --git a/src/widgets/accessible/widgets.pro b/src/widgets/accessible/widgets.pro
index c6af6d3f71..da8607c637 100644
--- a/src/widgets/accessible/widgets.pro
+++ b/src/widgets/accessible/widgets.pro
@@ -1,10 +1,5 @@
TARGET = qtaccessiblewidgets
-PLUGIN_TYPE = accessible
-PLUGIN_EXTENDS = widgets
-PLUGIN_CLASS_NAME = AccessibleFactory
-load(qt_plugin)
-
QT += core-private gui-private widgets-private
QTDIR_build:REQUIRES += "contains(QT_CONFIG, accessibility)"
@@ -24,4 +19,7 @@ HEADERS += qaccessiblewidgets.h \
qaccessiblemenu.h \
itemviews.h
-
+PLUGIN_TYPE = accessible
+PLUGIN_EXTENDS = widgets
+PLUGIN_CLASS_NAME = AccessibleFactory
+load(qt_plugin)