Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qaccessiblemenu_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QACCESSIBLEMENU_H
5#define QACCESSIBLEMENU_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include <QtWidgets/qaccessiblewidget.h>
20#include <QtCore/qpointer.h>
21
23
24#if QT_CONFIG(accessibility)
25
26#if QT_CONFIG(menu)
27class QMenu;
28class QMenuBar;
29class QAction;
30
31class QAccessibleMenu : public QAccessibleWidget
32{
33public:
34 explicit QAccessibleMenu(QWidget *w);
35
36 int childCount() const override;
37 QAccessibleInterface *childAt(int x, int y) const override;
38
39 QString text(QAccessible::Text t) const override;
40 QAccessible::Role role() const override;
41 QAccessibleInterface *child(int index) const override;
42 QAccessibleInterface *parent() const override;
43 int indexOfChild( const QAccessibleInterface *child ) const override;
44
45protected:
46 QMenu *menu() const;
47};
48
49#if QT_CONFIG(menubar)
50class QAccessibleMenuBar : public QAccessibleWidget
51{
52public:
53 explicit QAccessibleMenuBar(QWidget *w);
54
55 QAccessibleInterface *child(int index) const override;
56 int childCount() const override;
57
58 int indexOfChild(const QAccessibleInterface *child) const override;
59
60protected:
61 QMenuBar *menuBar() const;
62};
63#endif // QT_CONFIG(menubar)
64
65
66class QAccessibleMenuItem : public QAccessibleInterface, public QAccessibleActionInterface
67{
68public:
69 explicit QAccessibleMenuItem(QWidget *owner, QAction *w);
70
71 ~QAccessibleMenuItem();
72 void *interface_cast(QAccessible::InterfaceType t) override;
73
74 int childCount() const override;
75 QAccessibleInterface *childAt(int x, int y) const override;
76 bool isValid() const override;
77 int indexOfChild(const QAccessibleInterface * child) const override;
78
79 QAccessibleInterface *parent() const override;
80 QAccessibleInterface *child(int index) const override;
81 QObject * object() const override;
82 QWindow *window() const override;
83
84 QRect rect() const override;
85 QAccessible::Role role() const override;
86 void setText(QAccessible::Text t, const QString & text) override;
87 QAccessible::State state() const override;
88 QString text(QAccessible::Text t) const override;
89
90 // QAccessibleActionInterface
91 QStringList actionNames() const override;
92 void doAction(const QString &actionName) override;
93 QStringList keyBindingsForAction(const QString &actionName) const override;
94
95 QWidget *owner() const;
96protected:
97 QAction *action() const;
98private:
99 QAction *m_action;
100 QPointer<QWidget> m_owner; // can hold either QMenu or the QMenuBar that contains the action
101};
102
103#endif // QT_CONFIG(menu)
104
106#endif // QT_CONFIG(accessibility)
107#endif // QACCESSIBLEMENU_H
\inmodule QtGui
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
The QMenuBar class provides a horizontal menu bar.
Definition qmenubar.h:20
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
\inmodule QtGui
Definition qwindow.h:63
QString text
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLuint index
[2]
GLuint object
[3]
GLint y
GLdouble GLdouble t
Definition qopenglext.h:243
QLayoutItem * child
[0]
aWidget window() -> setWindowTitle("New Window Title")
[2]
insertRed setText("insert red text")
QMenu menu
[5]
QMenuBar * menuBar
[0]