Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | QInputMethod::QInputMethod() | - |
8 | : QObject(*new QInputMethodPrivate) | - |
9 | { | - |
10 | } executed: } Execution Count:289 | 289 |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | QInputMethod::~QInputMethod() | - |
16 | { | - |
17 | } | - |
18 | QTransform QInputMethod::inputItemTransform() const | - |
19 | { | - |
20 | const QInputMethodPrivate * const d = d_func(); | - |
21 | return d->inputItemTransform; executed: return d->inputItemTransform; Execution Count:2 | 2 |
22 | } | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | void QInputMethod::setInputItemTransform(const QTransform &transform) | - |
30 | { | - |
31 | QInputMethodPrivate * const d = d_func(); | - |
32 | if (d->inputItemTransform == transform) evaluated: d->inputItemTransform == transform yes Evaluation Count:1694 | yes Evaluation Count:634 |
| 634-1694 |
33 | return; executed: return; Execution Count:1694 | 1694 |
34 | | - |
35 | d->inputItemTransform = transform; | - |
36 | cursorRectangleChanged(); | - |
37 | } executed: } Execution Count:634 | 634 |
38 | QRectF QInputMethod::cursorRectangle() const | - |
39 | { | - |
40 | const QInputMethodPrivate * const d = d_func(); | - |
41 | | - |
42 | QObject *focusObject = (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject(); | - |
43 | if (!focusObject) evaluated: !focusObject yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-2 |
44 | return QRectF(); executed: return QRectF(); Execution Count:1 | 1 |
45 | | - |
46 | QInputMethodQueryEvent query(Qt::ImCursorRectangle); | - |
47 | QGuiApplication::sendEvent(focusObject, &query); | - |
48 | QRectF r = query.value(Qt::ImCursorRectangle).toRectF(); | - |
49 | if (!r.isValid()) partially evaluated: !r.isValid() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
50 | return QRectF(); never executed: return QRectF(); | 0 |
51 | | - |
52 | return d->inputItemTransform.mapRect(r); executed: return d->inputItemTransform.mapRect(r); Execution Count:2 | 2 |
53 | } | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | QRectF QInputMethod::keyboardRectangle() const | - |
60 | { | - |
61 | const QInputMethodPrivate * const d = d_func(); | - |
62 | QPlatformInputContext *ic = d->platformInputContext(); | - |
63 | if (ic) partially evaluated: ic yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
64 | return ic->keyboardRect(); executed: return ic->keyboardRect(); Execution Count:3 | 3 |
65 | return QRectF(); never executed: return QRectF(); | 0 |
66 | } | - |
67 | void QInputMethod::show() | - |
68 | { | - |
69 | QInputMethodPrivate * const d = d_func(); | - |
70 | QPlatformInputContext *ic = d->platformInputContext(); | - |
71 | if (ic) partially evaluated: ic yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
72 | ic->showInputPanel(); executed: ic->showInputPanel(); Execution Count:11 | 11 |
73 | } executed: } Execution Count:11 | 11 |
74 | void QInputMethod::hide() | - |
75 | { | - |
76 | QInputMethodPrivate * const d = d_func(); | - |
77 | QPlatformInputContext *ic = d->platformInputContext(); | - |
78 | if (ic) partially evaluated: ic yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
79 | ic->hideInputPanel(); executed: ic->hideInputPanel(); Execution Count:2 | 2 |
80 | } executed: } Execution Count:2 | 2 |
81 | bool QInputMethod::isVisible() const | - |
82 | { | - |
83 | const QInputMethodPrivate * const d = d_func(); | - |
84 | QPlatformInputContext *ic = d->platformInputContext(); | - |
85 | if (ic) partially evaluated: ic yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
86 | return ic->isInputPanelVisible(); executed: return ic->isInputPanelVisible(); Execution Count:5 | 5 |
87 | return false; never executed: return false; | 0 |
88 | } | - |
89 | void QInputMethod::setVisible(bool visible) | - |
90 | { | - |
91 | visible ? show() : hide(); | - |
92 | } executed: } Execution Count:2 | 2 |
93 | bool QInputMethod::isAnimating() const | - |
94 | { | - |
95 | const QInputMethodPrivate * const d = d_func(); | - |
96 | QPlatformInputContext *ic = d->platformInputContext(); | - |
97 | if (ic) partially evaluated: ic yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
98 | return ic->isAnimating(); executed: return ic->isAnimating(); Execution Count:3 | 3 |
99 | return false; never executed: return false; | 0 |
100 | } | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | QLocale QInputMethod::locale() const | - |
107 | { | - |
108 | const QInputMethodPrivate * const d = d_func(); | - |
109 | QPlatformInputContext *ic = d->platformInputContext(); | - |
110 | if (ic) partially evaluated: ic yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
111 | return ic->locale(); executed: return ic->locale(); Execution Count:1 | 1 |
112 | return QLocale::c(); never executed: return QLocale::c(); | 0 |
113 | } | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | | - |
119 | Qt::LayoutDirection QInputMethod::inputDirection() const | - |
120 | { | - |
121 | const QInputMethodPrivate * const d = d_func(); | - |
122 | QPlatformInputContext *ic = d->platformInputContext(); | - |
123 | if (ic) evaluated: ic yes Evaluation Count:93 | yes Evaluation Count:605 |
| 93-605 |
124 | return ic->inputDirection(); executed: return ic->inputDirection(); Execution Count:93 | 93 |
125 | return Qt::LeftToRight; executed: return Qt::LeftToRight; Execution Count:605 | 605 |
126 | } | - |
127 | void QInputMethod::update(Qt::InputMethodQueries queries) | - |
128 | { | - |
129 | QInputMethodPrivate * const d = d_func(); | - |
130 | | - |
131 | if (queries & Qt::ImEnabled) { evaluated: queries & Qt::ImEnabled yes Evaluation Count:19954 | yes Evaluation Count:463 |
| 463-19954 |
132 | QObject *focus = (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject(); | - |
133 | bool enabled = d->objectAcceptsInputMethod(focus); | - |
134 | QPlatformInputContextPrivate::setInputMethodAccepted(enabled); | - |
135 | } executed: } Execution Count:19954 | 19954 |
136 | | - |
137 | QPlatformInputContext *ic = d->platformInputContext(); | - |
138 | if (ic) evaluated: ic yes Evaluation Count:3501 | yes Evaluation Count:16916 |
| 3501-16916 |
139 | ic->update(queries); executed: ic->update(queries); Execution Count:3501 | 3501 |
140 | | - |
141 | if (queries & Qt::ImCursorRectangle) evaluated: queries & Qt::ImCursorRectangle yes Evaluation Count:19253 | yes Evaluation Count:1164 |
| 1164-19253 |
142 | cursorRectangleChanged(); executed: cursorRectangleChanged(); Execution Count:19253 | 19253 |
143 | } executed: } Execution Count:20417 | 20417 |
144 | | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | void QInputMethod::reset() | - |
152 | { | - |
153 | QInputMethodPrivate * const d = d_func(); | - |
154 | QPlatformInputContext *ic = d->platformInputContext(); | - |
155 | if (ic) evaluated: ic yes Evaluation Count:244 | yes Evaluation Count:4 |
| 4-244 |
156 | ic->reset(); executed: ic->reset(); Execution Count:244 | 244 |
157 | } executed: } Execution Count:248 | 248 |
158 | void QInputMethod::commit() | - |
159 | { | - |
160 | QInputMethodPrivate * const d = d_func(); | - |
161 | QPlatformInputContext *ic = d->platformInputContext(); | - |
162 | if (ic) evaluated: ic yes Evaluation Count:59 | yes Evaluation Count:1283 |
| 59-1283 |
163 | ic->commit(); executed: ic->commit(); Execution Count:59 | 59 |
164 | } executed: } Execution Count:1342 | 1342 |
165 | void QInputMethod::invokeAction(Action a, int cursorPosition) | - |
166 | { | - |
167 | QInputMethodPrivate * const d = d_func(); | - |
168 | QPlatformInputContext *ic = d->platformInputContext(); | - |
169 | if (ic) partially evaluated: ic yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
170 | ic->invokeAction(a, cursorPosition); executed: ic->invokeAction(a, cursorPosition); Execution Count:1 | 1 |
171 | } executed: } Execution Count:1 | 1 |
172 | | - |
173 | bool QInputMethodPrivate::objectAcceptsInputMethod(QObject *object) | - |
174 | { | - |
175 | bool enabled = false; | - |
176 | if (object) { evaluated: object yes Evaluation Count:4236 | yes Evaluation Count:15718 |
| 4236-15718 |
177 | QInputMethodQueryEvent query(Qt::ImEnabled); | - |
178 | QGuiApplication::sendEvent(object, &query); | - |
179 | enabled = query.value(Qt::ImEnabled).toBool(); | - |
180 | } executed: } Execution Count:4236 | 4236 |
181 | | - |
182 | return enabled; executed: return enabled; Execution Count:19954 | 19954 |
183 | } | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
| | |