qaccessibleobject.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/accessible/qaccessibleobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8class QAccessibleObjectPrivate-
9{-
10public:-
11 QPointer<QObject> object;-
12};-
13QAccessibleObject::QAccessibleObject(QObject *object)-
14{-
15 d = new QAccessibleObjectPrivate;-
16 d->object = object;-
17}
never executed: end of block
0
18-
19-
20-
21-
22-
23-
24-
25QAccessibleObject::~QAccessibleObject()-
26{-
27 delete d;-
28}
never executed: end of block
0
29-
30-
31-
32-
33QObject *QAccessibleObject::object() const-
34{-
35 return
never executed: return d->object;
d->object;
never executed: return d->object;
0
36}-
37-
38-
39-
40-
41bool QAccessibleObject::isValid() const-
42{-
43 return
never executed: return !d->object.isNull();
!d->object.isNull();
never executed: return !d->object.isNull();
0
44}-
45-
46-
47QRect QAccessibleObject::rect() const-
48{-
49 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
50}-
51-
52-
53void QAccessibleObject::setText(QAccessible::Text, const QString &)-
54{-
55}-
56-
57-
58QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const-
59{-
60 for (int i = 0; i < childCount()
i < childCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
61 QAccessibleInterface *childIface = child(i);-
62 ((!(childIface)) ? qt_assert("childIface",__FILE__,127) : qt_noop());-
63 if (childIface->rect().contains(x,y)
childIface->re....contains(x,y)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
64 return
never executed: return childIface;
childIface;
never executed: return childIface;
0
65 }
never executed: end of block
0
66 return
never executed: return 0;
0;
never executed: return 0;
0
67}-
68QAccessibleApplication::QAccessibleApplication()-
69: QAccessibleObject((static_cast<QGuiApplication *>(QCoreApplication::instance())))-
70{-
71}
never executed: end of block
0
72-
73QWindow *QAccessibleApplication::window() const-
74{-
75-
76-
77 return
never executed: return 0;
0;
never executed: return 0;
0
78}-
79-
80-
81static QObjectList topLevelObjects()-
82{-
83 QObjectList list;-
84 const QWindowList tlw(QGuiApplication::topLevelWindows());-
85 for (int i = 0; i < tlw.count()
i < tlw.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
86 QWindow *w = tlw.at(i);-
87 if (w->type() != Qt::Popup
w->type() != Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
&& w->type() != Qt::Desktop
w->type() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
88 if (QAccessibleInterface *root = w->accessibleRoot()
QAccessibleInt...cessibleRoot()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
89 if (root->object()
root->object()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
90 list.append(root->object());
never executed: list.append(root->object());
0
91 }
never executed: end of block
0
92 }
never executed: end of block
0
93 }
never executed: end of block
0
94-
95 return
never executed: return list;
list;
never executed: return list;
0
96}-
97-
98-
99int QAccessibleApplication::childCount() const-
100{-
101 return
never executed: return topLevelObjects().count();
topLevelObjects().count();
never executed: return topLevelObjects().count();
0
102}-
103-
104-
105int QAccessibleApplication::indexOfChild(const QAccessibleInterface *child) const-
106{-
107 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
108 return
never executed: return -1;
-1;
never executed: return -1;
0
109 const QObjectList tlw(topLevelObjects());-
110 return
never executed: return tlw.indexOf(child->object());
tlw.indexOf(child->object());
never executed: return tlw.indexOf(child->object());
0
111}-
112-
113QAccessibleInterface *QAccessibleApplication::parent() const-
114{-
115 return
never executed: return 0;
0;
never executed: return 0;
0
116}-
117-
118QAccessibleInterface *QAccessibleApplication::child(int index) const-
119{-
120 const QObjectList tlo(topLevelObjects());-
121 if (index >= 0
index >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& index < tlo.count()
index < tlo.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
122 return
never executed: return QAccessible::queryAccessibleInterface(tlo.at(index));
QAccessible::queryAccessibleInterface(tlo.at(index));
never executed: return QAccessible::queryAccessibleInterface(tlo.at(index));
0
123 return
never executed: return 0;
0;
never executed: return 0;
0
124}-
125-
126-
127-
128QAccessibleInterface *QAccessibleApplication::focusChild() const-
129{-
130 if (QWindow *window = QGuiApplication::focusWindow()
QWindow *windo...:focusWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
131 return
never executed: return window->accessibleRoot();
window->accessibleRoot();
never executed: return window->accessibleRoot();
0
132 return
never executed: return 0;
0;
never executed: return 0;
0
133}-
134-
135-
136QString QAccessibleApplication::text(QAccessible::Text t) const-
137{-
138 switch (t) {-
139 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
140 return
never executed: return QGuiApplication::applicationName();
QGuiApplication::applicationName();
never executed: return QGuiApplication::applicationName();
0
141 case
never executed: case QAccessible::Description:
QAccessible::Description:
never executed: case QAccessible::Description:
0
142 return
never executed: return QGuiApplication::applicationFilePath();
QGuiApplication::applicationFilePath();
never executed: return QGuiApplication::applicationFilePath();
0
143 default
never executed: default:
:
never executed: default:
0
144 break;
never executed: break;
0
145 }-
146 return
never executed: return QString();
QString();
never executed: return QString();
0
147}-
148-
149-
150QAccessible::Role QAccessibleApplication::role() const-
151{-
152 return
never executed: return QAccessible::Application;
QAccessible::Application;
never executed: return QAccessible::Application;
0
153}-
154-
155-
156QAccessible::State QAccessibleApplication::state() const-
157{-
158 return
never executed: return QAccessible::State();
QAccessible::State();
never executed: return QAccessible::State();
0
159}-
160-
161-
162-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9