accessible/qaccessibleobject.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8class QAccessibleObjectPrivate -
9{ -
10public: -
11 QPointer<QObject> object; -
12 -
13 QList<QByteArray> actionList() const; -
14}; -
15 -
16QList<QByteArray> QAccessibleObjectPrivate::actionList() const -
17{ -
18 QList<QByteArray> actionList; -
19 -
20 if (!object)
never evaluated: !object
0
21 return actionList;
never executed: return actionList;
0
22 -
23 const QMetaObject *mo = object->metaObject(); -
24 qt_noop(); -
25 -
26 QByteArray defaultAction = QMetaObject::normalizedSignature( -
27 mo->classInfo(mo->indexOfClassInfo("DefaultSlot")).value()); -
28 -
29 for (int i = 0; i < mo->methodCount(); ++i) {
never evaluated: i < mo->methodCount()
0
30 const QMetaMethod member = mo->method(i); -
31 if (member.methodType() != QMetaMethod::Slot && member.access() != QMetaMethod::Public)
never evaluated: member.methodType() != QMetaMethod::Slot
never evaluated: member.access() != QMetaMethod::Public
0
32 continue;
never executed: continue;
0
33 -
34 if (!qstrcmp(member.tag(), "QACCESSIBLE_SLOT")) {
never evaluated: !qstrcmp(member.tag(), "QACCESSIBLE_SLOT")
0
35 if (member.methodSignature() == defaultAction)
never evaluated: member.methodSignature() == defaultAction
0
36 actionList.prepend(defaultAction);
never executed: actionList.prepend(defaultAction);
0
37 else -
38 actionList << member.methodSignature();
never executed: actionList << member.methodSignature();
0
39 } -
40 }
never executed: }
0
41 -
42 return actionList;
never executed: return actionList;
0
43} -
44QAccessibleObject::QAccessibleObject(QObject *object) -
45{ -
46 d = new QAccessibleObjectPrivate; -
47 d->object = object; -
48}
executed: }
Execution Count:306
306
49 -
50 -
51 -
52 -
53 -
54 -
55 -
56QAccessibleObject::~QAccessibleObject() -
57{ -
58 delete d; -
59}
executed: }
Execution Count:252
252
60 -
61 -
62 -
63 -
64QObject *QAccessibleObject::object() const -
65{ -
66 -
67 -
68 -
69 -
70 return d->object;
executed: return d->object;
Execution Count:2932
2932
71} -
72 -
73 -
74 -
75 -
76bool QAccessibleObject::isValid() const -
77{ -
78 return !d->object.isNull();
executed: return !d->object.isNull();
Execution Count:22
22
79} -
80 -
81 -
82QRect QAccessibleObject::rect() const -
83{ -
84 return QRect();
never executed: return QRect();
0
85} -
86 -
87 -
88void QAccessibleObject::setText(QAccessible::Text, const QString &) -
89{ -
90} -
91 -
92 -
93QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const -
94{ -
95 for (int i = 0; i < childCount(); ++i) {
evaluated: i < childCount()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:4
4-11
96 QAccessibleInterface *childIface = child(i); -
97 qt_noop(); -
98 if (childIface->rect().contains(x,y)) {
evaluated: childIface->rect().contains(x,y)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:6
5-6
99 return childIface;
executed: return childIface;
Execution Count:5
5
100 } else { -
101 delete childIface; -
102 }
executed: }
Execution Count:6
6
103 } -
104 return 0;
executed: return 0;
Execution Count:4
4
105} -
106QAccessibleApplication::QAccessibleApplication() -
107: QAccessibleObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))) -
108{ -
109}
executed: }
Execution Count:2
2
110 -
111QWindow *QAccessibleApplication::window() const -
112{ -
113 -
114 -
115 return 0;
never executed: return 0;
0
116} -
117 -
118 -
119static QObjectList topLevelObjects() -
120{ -
121 QObjectList list; -
122 const QWindowList tlw(QGuiApplication::topLevelWindows()); -
123 for (int i = 0; i < tlw.count(); ++i) {
never evaluated: i < tlw.count()
0
124 QWindow *w = tlw.at(i); -
125 if (w->type() != Qt::Popup && w->type() != Qt::Desktop) {
never evaluated: w->type() != Qt::Popup
never evaluated: w->type() != Qt::Desktop
0
126 if (QAccessibleInterface *root = w->accessibleRoot()) {
never evaluated: QAccessibleInterface *root = w->accessibleRoot()
0
127 if (root->object())
never evaluated: root->object()
0
128 list.append(root->object());
never executed: list.append(root->object());
0
129 delete root; -
130 }
never executed: }
0
131 }
never executed: }
0
132 }
never executed: }
0
133 -
134 return list;
never executed: return list;
0
135} -
136 -
137 -
138int QAccessibleApplication::childCount() const -
139{ -
140 return topLevelObjects().count();
never executed: return topLevelObjects().count();
0
141} -
142 -
143 -
144int QAccessibleApplication::indexOfChild(const QAccessibleInterface *child) const -
145{ -
146 const QObjectList tlw(topLevelObjects()); -
147 return tlw.indexOf(child->object());
never executed: return tlw.indexOf(child->object());
0
148} -
149 -
150QAccessibleInterface *QAccessibleApplication::parent() const -
151{ -
152 return 0;
never executed: return 0;
0
153} -
154 -
155QAccessibleInterface *QAccessibleApplication::child(int index) const -
156{ -
157 const QObjectList tlo(topLevelObjects()); -
158 if (index >= 0 && index < tlo.count())
never evaluated: index >= 0
never evaluated: index < tlo.count()
0
159 return QAccessible::queryAccessibleInterface(tlo.at(index));
never executed: return QAccessible::queryAccessibleInterface(tlo.at(index));
0
160 return 0;
never executed: return 0;
0
161} -
162 -
163 -
164 -
165QAccessibleInterface *QAccessibleApplication::focusChild() const -
166{ -
167 if (QWindow *window = QGuiApplication::focusWindow())
never evaluated: QWindow *window = QGuiApplication::focusWindow()
0
168 return window->accessibleRoot();
never executed: return window->accessibleRoot();
0
169 return 0;
never executed: return 0;
0
170} -
171 -
172 -
173QString QAccessibleApplication::text(QAccessible::Text t) const -
174{ -
175 switch (t) { -
176 case QAccessible::Name: -
177 return QGuiApplication::applicationName();
executed: return QGuiApplication::applicationName();
Execution Count:1
1
178 case QAccessible::Description: -
179 return QGuiApplication::applicationFilePath();
never executed: return QGuiApplication::applicationFilePath();
0
180 default: -
181 break;
never executed: break;
0
182 } -
183 return QString();
never executed: return QString();
0
184} -
185 -
186 -
187QAccessible::Role QAccessibleApplication::role() const -
188{ -
189 return QAccessible::Application;
executed: return QAccessible::Application;
Execution Count:2
2
190} -
191 -
192 -
193QAccessible::State QAccessibleApplication::state() const -
194{ -
195 return QAccessible::State();
executed: return QAccessible::State();
Execution Count:1
1
196} -
197 -
198 -
199 -
200 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial