summaryrefslogtreecommitdiffstats
path: root/src/plugins/accessible
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/accessible')
-rw-r--r--src/plugins/accessible/widgets/qaccessiblemenu.cpp2
-rw-r--r--src/plugins/accessible/widgets/qaccessiblemenu.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
index f248e6d05e..39ac335131 100644
--- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
@@ -206,7 +206,7 @@ int QAccessibleMenuItem::indexOfChild(const QAccessibleInterface * child) const
bool QAccessibleMenuItem::isValid() const
{
- return m_action ? true : false;
+ return m_action && m_owner ? true : false;
}
QAccessibleInterface *QAccessibleMenuItem::parent() const
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.h b/src/plugins/accessible/widgets/qaccessiblemenu.h
index 74d118a09e..f933a4a37e 100644
--- a/src/plugins/accessible/widgets/qaccessiblemenu.h
+++ b/src/plugins/accessible/widgets/qaccessiblemenu.h
@@ -43,6 +43,7 @@
#define QACCESSIBLEMENU_H
#include <QtWidgets/private/qaccessiblewidget_p.h>
+#include <QtCore/qpointer.h>
QT_BEGIN_NAMESPACE
@@ -120,7 +121,7 @@ protected:
QAction *action() const;
private:
QAction *m_action;
- QWidget *m_owner; // can hold either QMenu or the QMenuBar that contains the action
+ QPointer<QWidget> m_owner; // can hold either QMenu or the QMenuBar that contains the action
};
#endif // QT_NO_MENU