OpenCoverage

qquicktextinput.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextinput.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12static bool qmlDisableDistanceField() { static enum { Yes, No, Unknown } status = Unknown; if (status == Unknown
status == UnknownDescription
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 7122 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) { status = No; if (__builtin_expect(!!(!qEnvironmentVariableIsEmpty("QML_DISABLE_DISTANCEFIELD")), false)
__builtin_expe...ELD")), false)Description
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) { const QByteArray v = qgetenv("QML_DISABLE_DISTANCEFIELD"); if (v != "0"
v != "0"Description
TRUEnever evaluated
FALSEnever evaluated
&& v != "false"
v != "false"Description
TRUEnever evaluated
FALSEnever evaluated
) status = Yes;
never executed: status = Yes;
}
never executed: end of block
}
executed 10 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
return
executed 7132 times by 5 tests: return status == Yes;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
status == Yes;
executed 7132 times by 5 tests: return status == Yes;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
}
0-7132
13QQuickTextInput::QQuickTextInput(QQuickItem* parent)-
14: QQuickImplicitSizeItem(*(new QQuickTextInputPrivate), parent)-
15{-
16 QQuickTextInputPrivate * const d = d_func();-
17 d->init();-
18}
executed 1042 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1042
19-
20QQuickTextInput::QQuickTextInput(QQuickTextInputPrivate &dd, QQuickItem *parent)-
21: QQuickImplicitSizeItem(dd, parent)-
22{-
23 QQuickTextInputPrivate * const d = d_func();-
24 d->init();-
25}
never executed: end of block
0
26-
27QQuickTextInput::~QQuickTextInput()-
28{-
29}-
30-
31void QQuickTextInput::componentComplete()-
32{-
33 QQuickTextInputPrivate * const d = d_func();-
34-
35 QQuickImplicitSizeItem::componentComplete();-
36-
37 d->checkIsValid();-
38 d->updateLayout();-
39 updateCursorRectangle();-
40 if (d->cursorComponent && isCursorVisible()
isCursorVisible()Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-14
41 QQuickTextUtil::createCursor(d);
never executed: QQuickTextUtil::createCursor(d);
0
42}
executed 1022 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1022
43QString QQuickTextInput::text() const-
44{-
45 const QQuickTextInputPrivate * const d = d_func();-
46-
47 QString content = d->m_text;-
48 QString res = d->m_maskData
d->m_maskDataDescription
TRUEevaluated 1164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3310 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
? d->stripString(content) : content;
1164-3310
49 return
executed 4474 times by 4 tests: return (res.isNull() ? QString::fromLatin1("") : res);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
(res.isNull() ? QString::fromLatin1("") : res);
executed 4474 times by 4 tests: return (res.isNull() ? QString::fromLatin1("") : res);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
4474
50}-
51-
52void QQuickTextInput::setText(const QString &s)-
53{-
54 QQuickTextInputPrivate * const d = d_func();-
55 if (s == text()
s == text()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 1244 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
36-1244
56 return;
executed 36 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicktextinput
36
57-
58-
59 d->cancelPreedit();-
60-
61 d->internalSetText(s, -1, false);-
62}
executed 1244 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1244
63QQuickTextInput::RenderType QQuickTextInput::renderType() const-
64{-
65 const QQuickTextInputPrivate * const d = d_func();-
66 return
executed 6 times by 1 test: return d->renderType;
Executed by:
  • tst_qquicktextinput
d->renderType;
executed 6 times by 1 test: return d->renderType;
Executed by:
  • tst_qquicktextinput
6
67}-
68-
69void QQuickTextInput::setRenderType(QQuickTextInput::RenderType renderType)-
70{-
71 QQuickTextInputPrivate * const d = d_func();-
72 if (d->renderType == renderType
d->renderType == renderTypeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-4
73 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
74-
75 d->renderType = renderType;-
76 renderTypeChanged();-
77-
78 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-4
79 d->updateLayout();
executed 4 times by 1 test: d->updateLayout();
Executed by:
  • tst_qquicktextinput
4
80}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
81int QQuickTextInput::length() const-
82{-
83 const QQuickTextInputPrivate * const d = d_func();-
84 return
executed 166 times by 1 test: return d->m_text.length();
Executed by:
  • tst_qquicktextinput
d->m_text.length();
executed 166 times by 1 test: return d->m_text.length();
Executed by:
  • tst_qquicktextinput
166
85}-
86QString QQuickTextInput::getText(int start, int end) const-
87{-
88 const QQuickTextInputPrivate * const d = d_func();-
89-
90 if (start > end
start > endDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-50
91 qSwap(start, end);
executed 2 times by 1 test: qSwap(start, end);
Executed by:
  • tst_qquicktextinput
2
92-
93 return
executed 52 times by 1 test: return d->m_text.mid(start, end - start);
Executed by:
  • tst_qquicktextinput
d->m_text.mid(start, end - start);
executed 52 times by 1 test: return d->m_text.mid(start, end - start);
Executed by:
  • tst_qquicktextinput
52
94}-
95-
96QString QQuickTextInputPrivate::realText() const-
97{-
98 QString res = m_maskData
m_maskDataDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? stripString(m_text) : m_text;
0-4
99 return
executed 4 times by 1 test: return (res.isNull() ? QString::fromLatin1("") : res);
Executed by:
  • tst_qquicktextinput
(res.isNull() ? QString::fromLatin1("") : res);
executed 4 times by 1 test: return (res.isNull() ? QString::fromLatin1("") : res);
Executed by:
  • tst_qquicktextinput
4
100}-
101QFont QQuickTextInput::font() const-
102{-
103 const QQuickTextInputPrivate * const d = d_func();-
104 return
executed 178 times by 2 tests: return d->sourceFont;
Executed by:
  • tst_examples
  • tst_qquicktextinput
d->sourceFont;
executed 178 times by 2 tests: return d->sourceFont;
Executed by:
  • tst_examples
  • tst_qquicktextinput
178
105}-
106-
107void QQuickTextInput::setFont(const QFont &font)-
108{-
109 QQuickTextInputPrivate * const d = d_func();-
110 if (d->sourceFont == font
d->sourceFont == fontDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
)
14-32
111 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_examples
14
112-
113 d->sourceFont = font;-
114 QFont oldFont = d->font;-
115 d->font = font;-
116 if (d->font.pointSizeF() != -1
d->font.pointSizeF() != -1Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
16
117-
118 qreal size = qRound(d->font.pointSizeF()*2.0);-
119 d->font.setPointSizeF(size/2.0);-
120 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
121 if (oldFont != d->font
oldFont != d->fontDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-32
122 d->updateLayout();-
123 updateCursorRectangle();-
124-
125 updateInputMethod(Qt::ImCursorRectangle | Qt::ImFont | Qt::ImAnchorRectangle);-
126-
127 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
32
128 fontChanged(d->sourceFont);-
129}
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
32
130-
131-
132-
133-
134-
135-
136QColor QQuickTextInput::color() const-
137{-
138 const QQuickTextInputPrivate * const d = d_func();-
139 return
executed 32 times by 1 test: return d->color;
Executed by:
  • tst_qquicktextinput
d->color;
executed 32 times by 1 test: return d->color;
Executed by:
  • tst_qquicktextinput
32
140}-
141-
142void QQuickTextInput::setColor(const QColor &c)-
143{-
144 QQuickTextInputPrivate * const d = d_func();-
145 if (c != d->color
c != d->colorDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-28
146 d->color = c;-
147 d->textLayoutDirty = true;-
148 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
149 polish();-
150 update();-
151 colorChanged();-
152 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
153}
executed 32 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
32
154-
155-
156-
157-
158-
159-
160-
161QColor QQuickTextInput::selectionColor() const-
162{-
163 const QQuickTextInputPrivate * const d = d_func();-
164 return
executed 30 times by 1 test: return d->selectionColor;
Executed by:
  • tst_qquicktextinput
d->selectionColor;
executed 30 times by 1 test: return d->selectionColor;
Executed by:
  • tst_qquicktextinput
30
165}-
166-
167void QQuickTextInput::setSelectionColor(const QColor &color)-
168{-
169 QQuickTextInputPrivate * const d = d_func();-
170 if (d->selectionColor == color
d->selectionColor == colorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-28
171 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
172-
173 d->selectionColor = color;-
174 if (d->hasSelectedText()
d->hasSelectedText()Description
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-28
175 d->textLayoutDirty = true;-
176 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
177 polish();-
178 update();-
179 }
never executed: end of block
0
180 selectionColorChanged();-
181}
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
182-
183-
184-
185-
186-
187QColor QQuickTextInput::selectedTextColor() const-
188{-
189 const QQuickTextInputPrivate * const d = d_func();-
190 return
executed 30 times by 1 test: return d->selectedTextColor;
Executed by:
  • tst_qquicktextinput
d->selectedTextColor;
executed 30 times by 1 test: return d->selectedTextColor;
Executed by:
  • tst_qquicktextinput
30
191}-
192-
193void QQuickTextInput::setSelectedTextColor(const QColor &color)-
194{-
195 QQuickTextInputPrivate * const d = d_func();-
196 if (d->selectedTextColor == color
d->selectedTextColor == colorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-26
197 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
4
198-
199 d->selectedTextColor = color;-
200 if (d->hasSelectedText()
d->hasSelectedText()Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-26
201 d->textLayoutDirty = true;-
202 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
203 polish();-
204 update();-
205 }
never executed: end of block
0
206 selectedTextColorChanged();-
207}
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
26
208QQuickTextInput::HAlignment QQuickTextInput::hAlign() const-
209{-
210 const QQuickTextInputPrivate * const d = d_func();-
211 return
executed 66 times by 2 tests: return d->hAlign;
Executed by:
  • tst_examples
  • tst_qquicktextinput
d->hAlign;
executed 66 times by 2 tests: return d->hAlign;
Executed by:
  • tst_examples
  • tst_qquicktextinput
66
212}-
213-
214void QQuickTextInput::setHAlign(HAlignment align)-
215{-
216 QQuickTextInputPrivate * const d = d_func();-
217 bool forceAlign = d->hAlignImplicit
d->hAlignImplicitDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& d->effectiveLayoutMirror
d->effectiveLayoutMirrorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
2-28
218 d->hAlignImplicit = false;-
219 if (d->setHAlign(align, forceAlign)
d->setHAlign(a...n, forceAlign)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& isComponentComplete()
isComponentComplete()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-28
220 d->updateLayout();-
221 updateCursorRectangle();-
222 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
223}
executed 34 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
34
224-
225void QQuickTextInput::resetHAlign()-
226{-
227 QQuickTextInputPrivate * const d = d_func();-
228 d->hAlignImplicit = true;-
229 if (d->determineHorizontalAlignment()
d->determineHo...talAlignment()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
&& isComponentComplete()
isComponentComplete()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-16
230 d->updateLayout();-
231 updateCursorRectangle();-
232 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
233}
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
20
234-
235QQuickTextInput::HAlignment QQuickTextInput::effectiveHAlign() const-
236{-
237 const QQuickTextInputPrivate * const d = d_func();-
238 QQuickTextInput::HAlignment effectiveAlignment = d->hAlign;-
239 if (!d->hAlignImplicit
!d->hAlignImplicitDescription
TRUEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6190 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
&& d->effectiveLayoutMirror
d->effectiveLayoutMirrorDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
22-6190
240 switch (d->hAlign) {-
241 case
executed 10 times by 1 test: case QQuickTextInput::AlignLeft:
Executed by:
  • tst_qquicktextinput
QQuickTextInput::AlignLeft:
executed 10 times by 1 test: case QQuickTextInput::AlignLeft:
Executed by:
  • tst_qquicktextinput
10
242 effectiveAlignment = QQuickTextInput::AlignRight;-
243 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
10
244 case
executed 12 times by 1 test: case QQuickTextInput::AlignRight:
Executed by:
  • tst_qquicktextinput
QQuickTextInput::AlignRight:
executed 12 times by 1 test: case QQuickTextInput::AlignRight:
Executed by:
  • tst_qquicktextinput
12
245 effectiveAlignment = QQuickTextInput::AlignLeft;-
246 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
12
247 default
never executed: default:
:
never executed: default:
0
248 break;
never executed: break;
0
249 }-
250 }-
251 return
executed 6350 times by 5 tests: return effectiveAlignment;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
effectiveAlignment;
executed 6350 times by 5 tests: return effectiveAlignment;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6350
252}-
253-
254bool QQuickTextInputPrivate::setHAlign(QQuickTextInput::HAlignment alignment, bool forceAlign)-
255{-
256 QQuickTextInput * const q = q_func();-
257 if ((hAlign != alignment
hAlign != alignmentDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 4724 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
|| forceAlign
forceAlignDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4722 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) && alignment <= QQuickTextInput::AlignHCenter
alignment <= Q...::AlignHCenterDescription
TRUEevaluated 68 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4724
258 QQuickTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();-
259 hAlign = alignment;-
260 q->horizontalAlignmentChanged(alignment);-
261 if (oldEffectiveHAlign != q->effectiveHAlign()
oldEffectiveHA...ectiveHAlign()Description
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-66
262 q->effectiveHorizontalAlignmentChanged();
executed 66 times by 2 tests: q->effectiveHorizontalAlignmentChanged();
Executed by:
  • tst_examples
  • tst_qquicktextinput
66
263 return
executed 68 times by 2 tests: return true;
Executed by:
  • tst_examples
  • tst_qquicktextinput
true;
executed 68 times by 2 tests: return true;
Executed by:
  • tst_examples
  • tst_qquicktextinput
68
264 }-
265 return
executed 4722 times by 5 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
false;
executed 4722 times by 5 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
4722
266}-
267-
268Qt::LayoutDirection QQuickTextInputPrivate::textDirection() const-
269{-
270 QString text = m_text;-
271-
272 if (text.isEmpty()
text.isEmpty()Description
TRUEevaluated 1816 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 9088 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
1816-9088
273 text = m_textLayout.preeditAreaText();
executed 1816 times by 5 tests: text = m_textLayout.preeditAreaText();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1816
274-
275-
276 const QChar *character = text.constData();-
277 while (!character->isNull()
!character->isNull()Description
TRUEevaluated 25808 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 3858 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
3858-25808
278 switch (character->direction()) {-
279 case
executed 6958 times by 4 tests: case QChar::DirL:
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
QChar::DirL:
executed 6958 times by 4 tests: case QChar::DirL:
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
6958
280 return
executed 6958 times by 4 tests: return Qt::LeftToRight;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
Qt::LeftToRight;
executed 6958 times by 4 tests: return Qt::LeftToRight;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
6958
281 case
never executed: case QChar::DirR:
QChar::DirR:
never executed: case QChar::DirR:
0
282 case
executed 88 times by 2 tests: case QChar::DirAL:
Executed by:
  • tst_examples
  • tst_qquicktextinput
QChar::DirAL:
executed 88 times by 2 tests: case QChar::DirAL:
Executed by:
  • tst_examples
  • tst_qquicktextinput
88
283 case
never executed: case QChar::DirAN:
QChar::DirAN:
never executed: case QChar::DirAN:
0
284 return
executed 88 times by 2 tests: return Qt::RightToLeft;
Executed by:
  • tst_examples
  • tst_qquicktextinput
Qt::RightToLeft;
executed 88 times by 2 tests: return Qt::RightToLeft;
Executed by:
  • tst_examples
  • tst_qquicktextinput
88
285 default
executed 18762 times by 2 tests: default:
Executed by:
  • tst_examples
  • tst_qquicktextinput
:
executed 18762 times by 2 tests: default:
Executed by:
  • tst_examples
  • tst_qquicktextinput
18762
286 break;
executed 18762 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquicktextinput
18762
287 }-
288 character++;-
289 }
executed 18762 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
18762
290 return
executed 3858 times by 5 tests: return Qt::LayoutDirectionAuto;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
Qt::LayoutDirectionAuto;
executed 3858 times by 5 tests: return Qt::LayoutDirectionAuto;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
3858
291}-
292-
293Qt::LayoutDirection QQuickTextInputPrivate::layoutDirection() const-
294{-
295 Qt::LayoutDirection direction = m_layoutDirection;-
296 if (direction == Qt::LayoutDirectionAuto
direction == Q...tDirectionAutoDescription
TRUEevaluated 6148 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
58-6148
297 direction = textDirection();-
298-
299 if (direction == Qt::LayoutDirectionAuto
direction == Q...tDirectionAutoDescription
TRUEevaluated 1674 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 4474 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
1674-4474
300 direction = QGuiApplication::inputMethod()->inputDirection();
executed 1674 times by 5 tests: direction = QGuiApplication::inputMethod()->inputDirection();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1674
301-
302 }
executed 6148 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6148
303 return
executed 6206 times by 5 tests: return (direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
(direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;
executed 6206 times by 5 tests: return (direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6206
304}-
305-
306bool QQuickTextInputPrivate::determineHorizontalAlignment()-
307{-
308 if (hAlignImplicit
hAlignImplicitDescription
TRUEevaluated 4756 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-4756
309-
310 Qt::LayoutDirection direction = textDirection();-
311-
312 if (direction == Qt::LayoutDirectionAuto
direction == Q...tDirectionAutoDescription
TRUEevaluated 2184 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 2572 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
2184-2572
313 direction = QGuiApplication::inputMethod()->inputDirection();
executed 2184 times by 5 tests: direction = QGuiApplication::inputMethod()->inputDirection();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
2184
314-
315 return
executed 4756 times by 5 tests: return setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);
executed 4756 times by 5 tests: return setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
4756
316 }-
317 return
executed 16 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 16 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
16
318}-
319-
320QQuickTextInput::VAlignment QQuickTextInput::vAlign() const-
321{-
322 const QQuickTextInputPrivate * const d = d_func();-
323 return
executed 6 times by 1 test: return d->vAlign;
Executed by:
  • tst_qquicktextinput
d->vAlign;
executed 6 times by 1 test: return d->vAlign;
Executed by:
  • tst_qquicktextinput
6
324}-
325-
326void QQuickTextInput::setVAlign(QQuickTextInput::VAlignment alignment)-
327{-
328 QQuickTextInputPrivate * const d = d_func();-
329 if (alignment == d->vAlign
alignment == d->vAlignDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-20
330 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
4
331 d->vAlign = alignment;-
332 verticalAlignmentChanged(d->vAlign);-
333 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
8-12
334 updateCursorRectangle();-
335 d->updateBaselineOffset();-
336 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
337}
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
20
338QQuickTextInput::WrapMode QQuickTextInput::wrapMode() const-
339{-
340 const QQuickTextInputPrivate * const d = d_func();-
341 return
executed 8 times by 1 test: return d->wrapMode;
Executed by:
  • tst_qquicktextinput
d->wrapMode;
executed 8 times by 1 test: return d->wrapMode;
Executed by:
  • tst_qquicktextinput
8
342}-
343-
344void QQuickTextInput::setWrapMode(WrapMode mode)-
345{-
346 QQuickTextInputPrivate * const d = d_func();-
347 if (mode == d->wrapMode
mode == d->wrapModeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
6-42
348 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
6
349 d->wrapMode = mode;-
350 d->updateLayout();-
351 updateCursorRectangle();-
352 wrapModeChanged();-
353}
executed 42 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
42
354-
355void QQuickTextInputPrivate::mirrorChange()-
356{-
357 QQuickTextInput * const q = q_func();-
358 if (q->isComponentComplete()
q->isComponentComplete()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4
359 if (!hAlignImplicit
!hAlignImplicitDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (hAlign == QQuickTextInput::AlignRight
hAlign == QQui...ut::AlignRightDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| hAlign == QQuickTextInput::AlignLeft
hAlign == QQui...put::AlignLeftDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-2
360 q->updateCursorRectangle();-
361 q->effectiveHorizontalAlignmentChanged();-
362 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
363 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
364}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
365bool QQuickTextInput::isReadOnly() const-
366{-
367 const QQuickTextInputPrivate * const d = d_func();-
368 return
executed 305 times by 4 tests: return d->m_readOnly;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
d->m_readOnly;
executed 305 times by 4 tests: return d->m_readOnly;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
305
369}-
370-
371void QQuickTextInput::setReadOnly(bool ro)-
372{-
373 QQuickTextInputPrivate * const d = d_func();-
374 if (d->m_readOnly == ro
d->m_readOnly == roDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
)
2-38
375 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
376-
377-
378 setFlag(QQuickItem::ItemAcceptsInputMethod, !ro);-
379-
380 d->m_readOnly = ro;-
381 d->setCursorPosition(d->end());-
382-
383 updateInputMethod(Qt::ImEnabled);-
384-
385 q_canPasteChanged();-
386 d->emitUndoRedoChanged();-
387 readOnlyChanged(ro);-
388 if (ro
roDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-24
389 setCursorVisible(false);-
390 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
else if (hasActiveFocus()
hasActiveFocus()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-24
391 setCursorVisible(true);-
392 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
393 update();-
394}
executed 38 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
38
395int QQuickTextInput::maxLength() const-
396{-
397 const QQuickTextInputPrivate * const d = d_func();-
398 return
executed 2 times by 1 test: return d->m_maxLength;
Executed by:
  • tst_qquicktextinput
d->m_maxLength;
executed 2 times by 1 test: return d->m_maxLength;
Executed by:
  • tst_qquicktextinput
2
399}-
400-
401void QQuickTextInput::setMaxLength(int ml)-
402{-
403 QQuickTextInputPrivate * const d = d_func();-
404 if (d->m_maxLength == ml
d->m_maxLength == mlDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| d->m_maskData
d->m_maskDataDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-2
405 return;
never executed: return;
0
406-
407 d->m_maxLength = ml;-
408 d->internalSetText(d->m_text, -1, false);-
409-
410 maximumLengthChanged(ml);-
411}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
412bool QQuickTextInput::isCursorVisible() const-
413{-
414 const QQuickTextInputPrivate * const d = d_func();-
415 return
executed 58 times by 1 test: return d->cursorVisible;
Executed by:
  • tst_qquicktextinput
d->cursorVisible;
executed 58 times by 1 test: return d->cursorVisible;
Executed by:
  • tst_qquicktextinput
58
416}-
417-
418void QQuickTextInput::setCursorVisible(bool on)-
419{-
420 QQuickTextInputPrivate * const d = d_func();-
421 if (d->cursorVisible == on
d->cursorVisible == onDescription
TRUEevaluated 360 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 542 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
360-542
422 return;
executed 360 times by 2 tests: return;
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
360
423 d->cursorVisible = on;-
424 if (on
onDescription
TRUEevaluated 404 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 138 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& isComponentComplete()
isComponentComplete()Description
TRUEevaluated 390 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
)
14-404
425 QQuickTextUtil::createCursor(d);
executed 390 times by 3 tests: QQuickTextUtil::createCursor(d);
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
390
426 if (!d->cursorItem
!d->cursorItemDescription
TRUEevaluated 500 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
42-500
427 d->updateCursorBlinking();
executed 500 times by 4 tests: d->updateCursorBlinking();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
500
428 cursorVisibleChanged(d->cursorVisible);-
429}
executed 542 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
542
430-
431-
432-
433-
434-
435int QQuickTextInput::cursorPosition() const-
436{-
437 const QQuickTextInputPrivate * const d = d_func();-
438 return
executed 382 times by 1 test: return d->m_cursor;
Executed by:
  • tst_qquicktextinput
d->m_cursor;
executed 382 times by 1 test: return d->m_cursor;
Executed by:
  • tst_qquicktextinput
382
439}-
440-
441void QQuickTextInput::setCursorPosition(int cp)-
442{-
443 QQuickTextInputPrivate * const d = d_func();-
444 if (cp < 0
cp < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 916 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| cp > text().length()
cp > text().length()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 908 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-916
445 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
10
446 d->moveCursor(cp);-
447}
executed 908 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
908
448QRectF QQuickTextInput::cursorRectangle() const-
449{-
450 const QQuickTextInputPrivate * const d = d_func();-
451-
452 int c = d->m_cursor;-
453-
454 c += d->m_preeditCursor;-
455-
456 if (d->m_echoMode == NoEcho
d->m_echoMode == NoEchoDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2720 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
2-2720
457 c = 0;
executed 2 times by 1 test: c = 0;
Executed by:
  • tst_qquicktextinput
2
458 QTextLine l = d->m_textLayout.lineForTextPosition(c);-
459 if (!l.isValid()
!l.isValid()Description
TRUEnever evaluated
FALSEevaluated 2722 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
0-2722
460 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
461 qreal x = l.cursorToX(c) - d->hscroll + leftPadding();-
462 qreal y = l.y() - d->vscroll + topPadding();-
463 qreal w = 1;-
464 if (d->overwriteMode
d->overwriteModeDescription
TRUEnever evaluated
FALSEevaluated 2722 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-2722
465 if (c < text().length()
c < text().length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
466 w = l.cursorToX(c + 1) - x;
never executed: w = l.cursorToX(c + 1) - x;
0
467 else-
468 w = QFontMetrics(font()).width(QLatin1Char(' '));
never executed: w = QFontMetrics(font()).width(QLatin1Char(' '));
0
469 }-
470 return
executed 2722 times by 4 tests: return QRectF(x, y, w, l.height());
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
QRectF(x, y, w, l.height());
executed 2722 times by 4 tests: return QRectF(x, y, w, l.height());
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
2722
471}-
472int QQuickTextInput::selectionStart() const-
473{-
474 const QQuickTextInputPrivate * const d = d_func();-
475 return
executed 588 times by 1 test: return d->lastSelectionStart;
Executed by:
  • tst_qquicktextinput
d->lastSelectionStart;
executed 588 times by 1 test: return d->lastSelectionStart;
Executed by:
  • tst_qquicktextinput
588
476}-
477int QQuickTextInput::selectionEnd() const-
478{-
479 const QQuickTextInputPrivate * const d = d_func();-
480 return
executed 586 times by 1 test: return d->lastSelectionEnd;
Executed by:
  • tst_qquicktextinput
d->lastSelectionEnd;
executed 586 times by 1 test: return d->lastSelectionEnd;
Executed by:
  • tst_qquicktextinput
586
481}-
482void QQuickTextInput::select(int start, int end)-
483{-
484 QQuickTextInputPrivate * const d = d_func();-
485 if (start < 0
start < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 418 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| end < 0
end < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 414 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| start > d->m_text.length()
start > d->m_text.length()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 410 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| end > d->m_text.length()
end > d->m_text.length()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 406 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-418
486 return;
executed 16 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
16
487 d->setSelection(start, end-start);-
488}
executed 406 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
406
489QString QQuickTextInput::selectedText() const-
490{-
491 const QQuickTextInputPrivate * const d = d_func();-
492 return
executed 892 times by 1 test: return d->selectedText();
Executed by:
  • tst_qquicktextinput
d->selectedText();
executed 892 times by 1 test: return d->selectedText();
Executed by:
  • tst_qquicktextinput
892
493}-
494-
495-
496-
497-
498-
499-
500-
501bool QQuickTextInput::focusOnPress() const-
502{-
503 const QQuickTextInputPrivate * const d = d_func();-
504 return
executed 12 times by 1 test: return d->focusOnPress;
Executed by:
  • tst_qquicktextinput
d->focusOnPress;
executed 12 times by 1 test: return d->focusOnPress;
Executed by:
  • tst_qquicktextinput
12
505}-
506-
507void QQuickTextInput::setFocusOnPress(bool b)-
508{-
509 QQuickTextInputPrivate * const d = d_func();-
510 if (d->focusOnPress == b
d->focusOnPress == bDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
12-16
511 return;
executed 16 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
16
512-
513 d->focusOnPress = b;-
514-
515 activeFocusOnPressChanged(d->focusOnPress);-
516}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
517bool QQuickTextInput::autoScroll() const-
518{-
519 const QQuickTextInputPrivate * const d = d_func();-
520 return
never executed: return d->autoScroll;
d->autoScroll;
never executed: return d->autoScroll;
0
521}-
522-
523void QQuickTextInput::setAutoScroll(bool b)-
524{-
525 QQuickTextInputPrivate * const d = d_func();-
526 if (d->autoScroll == b
d->autoScroll == bDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-18
527 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
528-
529 d->autoScroll = b;-
530-
531 updateCursorRectangle();-
532 autoScrollChanged(d->autoScroll);-
533}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
18
534QValidator* QQuickTextInput::validator() const-
535{-
536-
537-
538-
539 const QQuickTextInputPrivate * const d = d_func();-
540 return
executed 18 times by 1 test: return d->m_validator;
Executed by:
  • tst_qquicktextinput
d->m_validator;
executed 18 times by 1 test: return d->m_validator;
Executed by:
  • tst_qquicktextinput
18
541-
542}-
543-
544void QQuickTextInput::setValidator(QValidator* v)-
545{-
546-
547-
548-
549 QQuickTextInputPrivate * const d = d_func();-
550 if (d->m_validator == v
d->m_validator == vDescription
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
)
0-36
551 return;
never executed: return;
0
552-
553 if (d->m_validator
d->m_validatorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
2-34
554 { QValidator *sender = (d->m_validator); QQuickTextInput *receiver = (this); const char *signal = (qFlagLocation("2""changed()" "\0" __FILE__ ":" "1049")); const char *method = (qFlagLocation("1""q_validatorChanged()" "\0" __FILE__ ":" "1049")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
0-2
555-
556 __FILE__-
557 ,-
558-
559 1049-
560 )); signalIdx = QValidator::staticMetaObject.indexOfSignal(signal+1); }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
0-2
561-
562 __FILE__-
563 ,-
564-
565 1049-
566 )); if (code == 1
code == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
executed 2 times by 1 test: methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_qquicktextinput
else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-2
567-
568 __FILE__-
569 ,-
570-
571 1049-
572 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }-
573-
574 ;-
575 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
576-
577 d->m_validator = v;-
578-
579 if (d->m_validator
d->m_validatorDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-36
580 { QValidator *sender = (d->m_validator); QQuickTextInput *receiver = (this); const char *signal = (qFlagLocation("2""changed()" "\0" __FILE__ ":" "1057")); const char *method = (qFlagLocation("1""q_validatorChanged()" "\0" __FILE__ ":" "1057")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
4-32
581-
582 __FILE__-
583 ,-
584-
585 1057-
586 )); signalIdx = QValidator::staticMetaObject.indexOfSignal(signal+1); }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
4-32
587-
588 __FILE__-
589 ,-
590-
591 1057-
592 )); if (code == 1
code == 1Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEnever evaluated
) methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
executed 4 times by 2 tests: methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquicktextinput
else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-4
593-
594 __FILE__-
595 ,-
596-
597 1057-
598 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
599-
600 ;-
601 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
36
602-
603 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
)
4-32
604 d->checkIsValid();
executed 4 times by 1 test: d->checkIsValid();
Executed by:
  • tst_qquicktextinput
4
605-
606 validatorChanged();-
607-
608}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
36
609-
610-
611void QQuickTextInput::q_validatorChanged()-
612{-
613 QQuickTextInputPrivate * const d = d_func();-
614 d->checkIsValid();-
615}
executed 70 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
70
616-
617-
618QRectF QQuickTextInputPrivate::anchorRectangle() const-
619{-
620 const QQuickTextInput * const q = q_func();-
621 QRectF rect;-
622 int a;-
623-
624-
625-
626-
627 if (m_selstart == m_selend
m_selstart == m_selendDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
628-
629-
630 a = m_cursor;
never executed: a = m_cursor;
0
631 else-
632 a = m_selstart == m_cursor
m_selstart == m_cursorDescription
TRUEnever evaluated
FALSEnever evaluated
? m_selend : m_selstart;
never executed: a = m_selstart == m_cursor ? m_selend : m_selstart;
0
633 if (a >= 0
a >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
634-
635 a += m_preeditCursor;-
636-
637 if (m_echoMode == QQuickTextInput::NoEcho
m_echoMode == ...tInput::NoEchoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
638 a = 0;
never executed: a = 0;
0
639 QTextLine l = m_textLayout.lineForTextPosition(a);-
640 if (l.isValid()
l.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
641 qreal x = l.cursorToX(a) - hscroll + q->leftPadding();-
642 qreal y = l.y() - vscroll + q->topPadding();-
643 rect.setRect(x, y, 1, l.height());-
644 }
never executed: end of block
0
645 }
never executed: end of block
0
646 return
never executed: return rect;
rect;
never executed: return rect;
0
647}-
648-
649void QQuickTextInputPrivate::checkIsValid()-
650{-
651 QQuickTextInput * const q = q_func();-
652-
653 ValidatorState state = hasAcceptableInput(m_text);-
654 if (!m_maskData
!m_maskDataDescription
TRUEevaluated 848 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 1302 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
848-1302
655 m_validInput = state != InvalidInput;
executed 848 times by 5 tests: m_validInput = state != InvalidInput;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
848
656 if (state != AcceptableInput
state != AcceptableInputDescription
TRUEevaluated 700 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 1450 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
700-1450
657 if (m_acceptableInput
m_acceptableInputDescription
TRUEevaluated 520 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 180 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
180-520
658 m_acceptableInput = false;-
659 q->acceptableInputChanged();-
660 }
executed 520 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
520
661 }
executed 700 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
else if (!m_acceptableInput
!m_acceptableInputDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1436 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
14-1436
662 m_acceptableInput = true;-
663 q->acceptableInputChanged();-
664 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
665}
executed 2150 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
2150
666QString QQuickTextInput::inputMask() const-
667{-
668 const QQuickTextInputPrivate * const d = d_func();-
669 return
executed 22 times by 1 test: return d->inputMask();
Executed by:
  • tst_qquicktextinput
d->inputMask();
executed 22 times by 1 test: return d->inputMask();
Executed by:
  • tst_qquicktextinput
22
670}-
671-
672void QQuickTextInput::setInputMask(const QString &im)-
673{-
674 QQuickTextInputPrivate * const d = d_func();-
675 if (d->inputMask() == im
d->inputMask() == imDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 256 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
88-256
676 return;
executed 88 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
88
677-
678 d->setInputMask(im);-
679 inputMaskChanged(d->inputMask());-
680}
executed 256 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
256
681bool QQuickTextInput::hasAcceptableInput() const-
682{-
683 const QQuickTextInputPrivate * const d = d_func();-
684 return
executed 230 times by 1 test: return d->m_acceptableInput;
Executed by:
  • tst_qquicktextinput
d->m_acceptableInput;
executed 230 times by 1 test: return d->m_acceptableInput;
Executed by:
  • tst_qquicktextinput
230
685}-
686Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const-
687{-
688 Qt::InputMethodHints hints = inputMethodHints;-
689 if (m_echoMode == QQuickTextInput::Password
m_echoMode == ...nput::PasswordDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 384 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
|| m_echoMode == QQuickTextInput::NoEcho
m_echoMode == ...tInput::NoEchoDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 382 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
2-384
690 hints |= Qt::ImhHiddenText;
executed 14 times by 1 test: hints |= Qt::ImhHiddenText;
Executed by:
  • tst_qquicktextinput
14
691 else if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
m_echoMode == ...wordEchoOnEditDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 378 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
4-378
692 hints &= ~Qt::ImhHiddenText;
executed 4 times by 1 test: hints &= ~Qt::ImhHiddenText;
Executed by:
  • tst_qquicktextinput
4
693 if (m_echoMode != QQuickTextInput::Normal
m_echoMode != ...tInput::NormalDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 378 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
18-378
694 hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
executed 18 times by 1 test: hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
Executed by:
  • tst_qquicktextinput
18
695 return
executed 396 times by 3 tests: return hints;
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
hints;
executed 396 times by 3 tests: return hints;
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
396
696}-
697QQuickTextInput::EchoMode QQuickTextInput::echoMode() const-
698{-
699 const QQuickTextInputPrivate * const d = d_func();-
700 return
executed 112 times by 1 test: return QQuickTextInput::EchoMode(d->m_echoMode);
Executed by:
  • tst_qquicktextinput
QQuickTextInput::EchoMode(d->m_echoMode);
executed 112 times by 1 test: return QQuickTextInput::EchoMode(d->m_echoMode);
Executed by:
  • tst_qquicktextinput
112
701}-
702-
703void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)-
704{-
705 QQuickTextInputPrivate * const d = d_func();-
706 if (echoMode() == echo
echoMode() == echoDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
28-54
707 return;
executed 54 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
54
708 d->cancelPasswordEchoTimer();-
709 d->m_echoMode = echo;-
710 d->m_passwordEchoEditing = false;-
711-
712 updateInputMethod(Qt::ImHints);-
713-
714 d->updateDisplayText();-
715 updateCursorRectangle();-
716-
717 echoModeChanged(echoMode());-
718}
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
719Qt::InputMethodHints QQuickTextInput::inputMethodHints() const-
720{-
721-
722-
723-
724 const QQuickTextInputPrivate * const d = d_func();-
725 return
executed 14 times by 1 test: return d->inputMethodHints;
Executed by:
  • tst_qquicktextinput
d->inputMethodHints;
executed 14 times by 1 test: return d->inputMethodHints;
Executed by:
  • tst_qquicktextinput
14
726-
727}-
728-
729void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)-
730{-
731-
732-
733-
734 QQuickTextInputPrivate * const d = d_func();-
735-
736 if (hints == d->inputMethodHints
hints == d->inputMethodHintsDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4
737 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
4
738-
739 d->inputMethodHints = hints;-
740 updateInputMethod(Qt::ImHints);-
741 inputMethodHintsChanged();-
742-
743}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
744QQmlComponent* QQuickTextInput::cursorDelegate() const-
745{-
746 const QQuickTextInputPrivate * const d = d_func();-
747 return
never executed: return d->cursorComponent;
d->cursorComponent;
never executed: return d->cursorComponent;
0
748}-
749-
750void QQuickTextInput::setCursorDelegate(QQmlComponent* c)-
751{-
752 QQuickTextInputPrivate * const d = d_func();-
753 QQuickTextUtil::setCursorDelegate(d, c);-
754}
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
24
755-
756void QQuickTextInput::createCursor()-
757{-
758 QQuickTextInputPrivate * const d = d_func();-
759 d->cursorPending = true;-
760 QQuickTextUtil::createCursor(d);-
761}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
762QRectF QQuickTextInput::positionToRectangle(int pos) const-
763{-
764 const QQuickTextInputPrivate * const d = d_func();-
765 if (d->m_echoMode == NoEcho
d->m_echoMode == NoEchoDescription
TRUEnever evaluated
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-420
766 pos = 0;
never executed: pos = 0;
0
767-
768 else if (pos > d->m_cursor
pos > d->m_cursorDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 394 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
26-394
769 pos += d->preeditAreaText().length();
executed 26 times by 1 test: pos += d->preeditAreaText().length();
Executed by:
  • tst_qquicktextinput
26
770-
771 QTextLine l = d->m_textLayout.lineForTextPosition(pos);-
772 if (!l.isValid()
!l.isValid()Description
TRUEnever evaluated
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-420
773 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
774 qreal x = l.cursorToX(pos) - d->hscroll;-
775 qreal y = l.y() - d->vscroll;-
776 qreal w = 1;-
777 if (d->overwriteMode
d->overwriteModeDescription
TRUEnever evaluated
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-420
778 if (pos < text().length()
pos < text().length()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
779 w = l.cursorToX(pos + 1) - x;
never executed: w = l.cursorToX(pos + 1) - x;
0
780 else-
781 w = QFontMetrics(font()).width(QLatin1Char(' '));
never executed: w = QFontMetrics(font()).width(QLatin1Char(' '));
0
782 }-
783 return
executed 420 times by 1 test: return QRectF(x, y, w, l.height());
Executed by:
  • tst_qquicktextinput
QRectF(x, y, w, l.height());
executed 420 times by 1 test: return QRectF(x, y, w, l.height());
Executed by:
  • tst_qquicktextinput
420
784}-
785void QQuickTextInput::positionAt(QQmlV4Function *args) const-
786{-
787 const QQuickTextInputPrivate * const d = d_func();-
788-
789 qreal x = 0;-
790 qreal y = 0;-
791 QTextLine::CursorPosition position = QTextLine::CursorBetweenCharacters;-
792-
793 if (args->length() < 1
args->length() < 1Description
TRUEnever evaluated
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-38
794 return;
never executed: return;
0
795-
796 int i = 0;-
797 QV4::Scope scope(args->v4engine());-
798 QV4::ScopedValue arg(scope, (*args)[0]);-
799 x = arg->toNumber();-
800-
801 if (++
++i < args->length()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
i < args->length()
++i < args->length()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-22
802 arg = (*args)[i];-
803 y = arg->toNumber();-
804 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
805-
806 if (++
++i < args->length()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
i < args->length()
++i < args->length()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
8-30
807 arg = (*args)[i];-
808 position = QTextLine::CursorPosition(arg->toInt32());-
809 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
810-
811 int pos = d->positionAt(x, y, position);-
812 const int cursor = d->m_cursor;-
813 if (pos > cursor
pos > cursorDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-24
814-
815 const int preeditLength = d->preeditAreaText().length();-
816 pos = pos > cursor + preeditLength
pos > cursor + preeditLengthDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
4-10
817 ? pos - preeditLength-
818 : cursor;-
819-
820-
821-
822 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
823 args->setReturnValue(QV4::Encode(pos));-
824}
executed 38 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
38
825-
826int QQuickTextInputPrivate::positionAt(qreal x, qreal y, QTextLine::CursorPosition position) const-
827{-
828 const QQuickTextInput * const q = q_func();-
829 x += hscroll - q->leftPadding();-
830 y += vscroll - q->topPadding();-
831 QTextLine line = m_textLayout.lineAt(0);-
832 for (int i = 1; i < m_textLayout.lineCount()
i < m_textLayout.lineCount()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 150 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
12-150
833 QTextLine nextLine = m_textLayout.lineAt(i);-
834-
835 if (y < (line.rect().bottom() + nextLine.y()) / 2
y < (line.rect...tLine.y()) / 2Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-8
836 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
8
837 line = nextLine;-
838 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
839 return
executed 158 times by 1 test: return line.isValid() ? line.xToCursor(x, position) : 0;
Executed by:
  • tst_qquicktextinput
line.isValid() ? line.xToCursor(x, position) : 0;
executed 158 times by 1 test: return line.isValid() ? line.xToCursor(x, position) : 0;
Executed by:
  • tst_qquicktextinput
158
840}-
841bool QQuickTextInput::overwriteMode() const-
842{-
843 const QQuickTextInputPrivate * const d = d_func();-
844 return
executed 6 times by 1 test: return d->overwriteMode;
Executed by:
  • tst_qquicktextinput
d->overwriteMode;
executed 6 times by 1 test: return d->overwriteMode;
Executed by:
  • tst_qquicktextinput
6
845}-
846-
847void QQuickTextInput::setOverwriteMode(bool overwrite)-
848{-
849 QQuickTextInputPrivate * const d = d_func();-
850 if (d->overwriteMode == overwrite
d->overwriteMode == overwriteDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-6
851 return;
never executed: return;
0
852 d->overwriteMode = overwrite;-
853 overwriteModeChanged(overwrite);-
854}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
855-
856void QQuickTextInput::keyPressEvent(QKeyEvent* ev)-
857{-
858 QQuickTextInputPrivate * const d = d_func();-
859-
860 bool ignore = (ev->key() == Qt::Key_Up
ev->key() == Qt::Key_UpDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1988 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| ev->key() == Qt::Key_Down
ev->key() == Qt::Key_DownDescription
TRUEnever evaluated
FALSEevaluated 1988 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) && ev->modifiers() == Qt::NoModifier
ev->modifiers(...Qt::NoModifierDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
;
0-1988
861 if (!ignore
!ignoreDescription
TRUEevaluated 1988 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (
(d->lastSelect...tSelectionEnd)Description
TRUEevaluated 1920 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquicktextinput
d->lastSelectionStart == d->lastSelectionEnd)
(d->lastSelect...tSelectionEnd)Description
TRUEevaluated 1920 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (ev->key() == Qt::Key_Right
ev->key() == Qt::Key_RightDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1880 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| ev->key() == Qt::Key_Left
ev->key() == Qt::Key_LeftDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1834 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
)) {
2-1988
862-
863-
864 int cursorPosition = d->m_cursor;-
865 if (cursorPosition == 0
cursorPosition == 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
16-70
866 ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight
d->layoutDirec...t::LeftToRightDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? Qt::Key_Left : Qt::Key_Right);
executed 16 times by 1 test: ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
Executed by:
  • tst_qquicktextinput
2-16
867 if (!ignore
!ignoreDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& cursorPosition == d->m_text.length()
cursorPosition..._text.length()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
6-80
868 ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight
d->layoutDirec...t::LeftToRightDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? Qt::Key_Right : Qt::Key_Left);
executed 14 times by 1 test: ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
Executed by:
  • tst_qquicktextinput
2-14
869 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
86
870 if (ignore
ignoreDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1976 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
14-1976
871 ev->ignore();-
872 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
14
873 d->processKeyEvent(ev);-
874 }
executed 1976 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1976
875 if (!ev->isAccepted()
!ev->isAccepted()Description
TRUEevaluated 226 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 1764 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
226-1764
876 QQuickImplicitSizeItem::keyPressEvent(ev);
executed 226 times by 2 tests: QQuickImplicitSizeItem::keyPressEvent(ev);
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
226
877}
executed 1990 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1990
878-
879-
880void QQuickTextInput::inputMethodEvent(QInputMethodEvent *ev)-
881{-
882 QQuickTextInputPrivate * const d = d_func();-
883 const bool wasComposing = d->hasImState;-
884 if (d->m_readOnly
d->m_readOnlyDescription
TRUEnever evaluated
FALSEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-348
885 ev->ignore();-
886 }
never executed: end of block
else {
0
887 d->processInputMethodEvent(ev);-
888 }
executed 348 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
348
889 if (!ev->isAccepted()
!ev->isAccepted()Description
TRUEnever evaluated
FALSEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-348
890 QQuickImplicitSizeItem::inputMethodEvent(ev);
never executed: QQuickImplicitSizeItem::inputMethodEvent(ev);
0
891-
892 if (wasComposing != d->hasImState
wasComposing != d->hasImStateDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 304 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
44-304
893 inputMethodComposingChanged();
executed 44 times by 1 test: inputMethodComposingChanged();
Executed by:
  • tst_qquicktextinput
44
894}
executed 348 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
348
895-
896-
897void QQuickTextInput::mouseDoubleClickEvent(QMouseEvent *event)-
898{-
899 QQuickTextInputPrivate * const d = d_func();-
900-
901 if (d->selectByMouse
d->selectByMouseDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-6
902-
903 d->commitPreedit();-
904-
905 int cursor = d->positionAt(event->localPos());-
906 d->selectWordAtPos(cursor);-
907 event->setAccepted(true);-
908 if (!d->hasPendingTripleClick()
!d->hasPendingTripleClick()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-4
909 d->tripleClickStartPoint = event->localPos();-
910 d->tripleClickTimer.start();-
911 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
912 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
6
913 if (d->sendMouseEventToInputContext(event)
d->sendMouseEv...Context(event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
914 return;
never executed: return;
0
915 QQuickImplicitSizeItem::mouseDoubleClickEvent(event);-
916 }
never executed: end of block
0
917}-
918-
919void QQuickTextInput::mousePressEvent(QMouseEvent *event)-
920{-
921 QQuickTextInputPrivate * const d = d_func();-
922-
923 d->pressPos = event->localPos();-
924-
925 if (d->sendMouseEventToInputContext(event)
d->sendMouseEv...Context(event)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-84
926 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
927-
928 if (d->selectByMouse
d->selectByMouseDescription
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-68
929 setKeepMouseGrab(false);-
930 d->selectPressed = true;-
931 QPointF distanceVector = d->pressPos - d->tripleClickStartPoint;-
932 if (d->hasPendingTripleClick()
d->hasPendingTripleClick()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
12-56
933 && distanceVector.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()
distanceVector...DragDistance()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-10
934 event->setAccepted(true);-
935 selectAll();-
936 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
10
937 }-
938 }
executed 58 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
58
939-
940 bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse
d->selectByMouseDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
941 int cursor = d->positionAt(event->localPos());-
942 d->moveCursor(cursor, mark);-
943-
944 if (d->focusOnPress
d->focusOnPressDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !(static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->setFocusOnTouchRelease()
!(static_cast<...TouchRelease()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-64
945 ensureActiveFocus();
executed 64 times by 1 test: ensureActiveFocus();
Executed by:
  • tst_qquicktextinput
64
946-
947 event->setAccepted(true);-
948}
executed 74 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
74
949-
950void QQuickTextInput::mouseMoveEvent(QMouseEvent *event)-
951{-
952 QQuickTextInputPrivate * const d = d_func();-
953-
954 if (d->selectPressed
d->selectPressedDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-36
955 if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance()
qAbs(int(event...DragDistance()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-36
956 setKeepMouseGrab(true);
executed 36 times by 1 test: setKeepMouseGrab(true);
Executed by:
  • tst_qquicktextinput
36
957-
958-
959 if (d->composeMode()
d->composeMode()Description
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-36
960-
961 int startPos = d->positionAt(d->pressPos);-
962 int currentPos = d->positionAt(event->localPos());-
963 if (startPos != currentPos
startPos != currentPosDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
964 d->setSelection(startPos, currentPos - startPos);
never executed: d->setSelection(startPos, currentPos - startPos);
0
965 }
never executed: end of block
else
0
966-
967 {-
968 moveCursorSelection(d->positionAt(event->localPos()), d->mouseSelectionMode);-
969 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
36
970 event->setAccepted(true);-
971 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
36
972 QQuickImplicitSizeItem::mouseMoveEvent(event);-
973 }
never executed: end of block
0
974}-
975-
976void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)-
977{-
978 QQuickTextInputPrivate * const d = d_func();-
979 if (d->sendMouseEventToInputContext(event)
d->sendMouseEv...Context(event)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-84
980 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
981 if (d->selectPressed
d->selectPressedDescription
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-68
982 d->selectPressed = false;-
983 setKeepMouseGrab(false);-
984 }
executed 68 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
68
985-
986 if (QGuiApplication::clipboard()->supportsSelection()
QGuiApplicatio...rtsSelection()Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-84
987 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-82
988 d->copy(QClipboard::Selection);-
989 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (!d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& event->button() == Qt::MidButton
event->button(... Qt::MidButtonDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-82
990 d->deselect();-
991 d->insert(QGuiApplication::clipboard()->text(QClipboard::Selection));-
992 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
993 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
84
994-
995-
996 if (d->focusOnPress
d->focusOnPressDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (static_cast<
(static_cast<Q...TouchRelease()Description
TRUEnever evaluated
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
QGuiApplication *>(QCoreApplication::instance()))->styleHints()->setFocusOnTouchRelease()
(static_cast<Q...TouchRelease()Description
TRUEnever evaluated
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-74
997 ensureActiveFocus();
never executed: ensureActiveFocus();
0
998-
999 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-84
1000 QQuickImplicitSizeItem::mouseReleaseEvent(event);
never executed: QQuickImplicitSizeItem::mouseReleaseEvent(event);
0
1001}
executed 84 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
84
1002-
1003bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event)-
1004{-
1005-
1006 if (composeMode()
composeMode()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 168 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-168
1007 int tmp_cursor = positionAt(event->localPos());-
1008 int mousePos = tmp_cursor - m_cursor;-
1009 if (mousePos >= 0
mousePos >= 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& mousePos <= m_textLayout.preeditAreaText().length()
mousePos <= m_...ext().length()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4
1010 if (event->type() == QEvent::MouseButtonRelease
event->type() ...eButtonReleaseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2
1011 QGuiApplication::inputMethod()->invokeAction(QInputMethod::Click, mousePos);-
1012 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
1013 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
4
1014 }-
1015 }
never executed: end of block
0
1016-
1017-
1018-
1019-
1020 return
executed 168 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 168 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
168
1021}-
1022-
1023void QQuickTextInput::mouseUngrabEvent()-
1024{-
1025 QQuickTextInputPrivate * const d = d_func();-
1026 d->selectPressed = false;-
1027 setKeepMouseGrab(false);-
1028}
executed 86 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
86
1029-
1030bool QQuickTextInput::event(QEvent* ev)-
1031{-
1032-
1033 QQuickTextInputPrivate * const d = d_func();-
1034 if (ev->type() == QEvent::ShortcutOverride
ev->type() == ...ortcutOverrideDescription
TRUEevaluated 1176 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 7113 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
1176-7113
1035 if (d->m_readOnly
d->m_readOnlyDescription
TRUEnever evaluated
FALSEevaluated 1176 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-1176
1036 return
never executed: return false;
false;
never executed: return false;
0
1037 QKeyEvent* ke = static_cast<QKeyEvent*>(ev);-
1038 if (ke == QKeySequence::Copy
ke == QKeySequence::CopyDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1166 times by 1 test
Evaluated by:
  • tst_qquicktextinput
10-1166
1039 || ke == QKeySequence::Paste
ke == QKeySequence::PasteDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1162 times by 1 test
Evaluated by:
  • tst_qquicktextinput
4-1162
1040 || ke == QKeySequence::Cut
ke == QKeySequence::CutDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1160
1041 || ke == QKeySequence::Redo
ke == QKeySequence::RedoDescription
TRUEnever evaluated
FALSEevaluated 1160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1160
1042 || ke == QKeySequence::Undo
ke == QKeySequence::UndoDescription
TRUEnever evaluated
FALSEevaluated 1160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1160
1043 || ke == QKeySequence::MoveToNextWord
ke == QKeySequ...MoveToNextWordDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1152 times by 1 test
Evaluated by:
  • tst_qquicktextinput
8-1152
1044 || ke == QKeySequence::MoveToPreviousWord
ke == QKeySequ...ToPreviousWordDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
8-1144
1045 || ke == QKeySequence::MoveToStartOfDocument
ke == QKeySequ...tartOfDocumentDescription
TRUEnever evaluated
FALSEevaluated 1144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1144
1046 || ke == QKeySequence::MoveToEndOfDocument
ke == QKeySequ...oEndOfDocumentDescription
TRUEnever evaluated
FALSEevaluated 1144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1144
1047 || ke == QKeySequence::SelectNextWord
ke == QKeySequ...SelectNextWordDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1142 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1142
1048 || ke == QKeySequence::SelectPreviousWord
ke == QKeySequ...ctPreviousWordDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1140 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1140
1049 || ke == QKeySequence::SelectStartOfLine
ke == QKeySequ...ectStartOfLineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1138 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1138
1050 || ke == QKeySequence::SelectEndOfLine
ke == QKeySequ...electEndOfLineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1136
1051 || ke == QKeySequence::SelectStartOfBlock
ke == QKeySequ...ctStartOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1136
1052 || ke == QKeySequence::SelectEndOfBlock
ke == QKeySequ...lectEndOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1136
1053 || ke == QKeySequence::SelectStartOfDocument
ke == QKeySequ...tartOfDocumentDescription
TRUEnever evaluated
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • tst_qquicktextinput
0-1136
1054 || ke == QKeySequence::SelectAll
ke == QKeySequence::SelectAllDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • tst_qquicktextinput
4-1132
1055 || ke == QKeySequence::SelectEndOfDocument
ke == QKeySequ...tEndOfDocumentDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1130 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-1130
1056 || ke == QKeySequence::DeleteCompleteLine
ke == QKeySequ...teCompleteLineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1128 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-1128
1057 ke->accept();-
1058 return
executed 48 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 48 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
48
1059 } else if (ke->modifiers() == Qt::NoModifier
ke->modifiers(...Qt::NoModifierDescription
TRUEevaluated 1046 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| ke->modifiers() == Qt::ShiftModifier
ke->modifiers(...:ShiftModifierDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
26-1046
1060 || ke->modifiers() == Qt::KeypadModifier
ke->modifiers(...KeypadModifierDescription
TRUEnever evaluated
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-56
1061 if (ke->key() < Qt::Key_Escape
ke->key() < Qt::Key_EscapeDescription
TRUEevaluated 976 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
96-976
1062 ke->accept();-
1063 return
executed 976 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 976 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
976
1064 } else {-
1065 switch (ke->key()) {-
1066 case
executed 14 times by 1 test: case Qt::Key_Delete:
Executed by:
  • tst_qquicktextinput
Qt::Key_Delete:
executed 14 times by 1 test: case Qt::Key_Delete:
Executed by:
  • tst_qquicktextinput
14
1067 case
executed 2 times by 1 test: case Qt::Key_Home:
Executed by:
  • tst_qquicktextinput
Qt::Key_Home:
executed 2 times by 1 test: case Qt::Key_Home:
Executed by:
  • tst_qquicktextinput
2
1068 case
never executed: case Qt::Key_End:
Qt::Key_End:
never executed: case Qt::Key_End:
0
1069 case
executed 36 times by 1 test: case Qt::Key_Backspace:
Executed by:
  • tst_qquicktextinput
Qt::Key_Backspace:
executed 36 times by 1 test: case Qt::Key_Backspace:
Executed by:
  • tst_qquicktextinput
36
1070 case
executed 10 times by 1 test: case Qt::Key_Left:
Executed by:
  • tst_qquicktextinput
Qt::Key_Left:
executed 10 times by 1 test: case Qt::Key_Left:
Executed by:
  • tst_qquicktextinput
10
1071 case
executed 6 times by 1 test: case Qt::Key_Right:
Executed by:
  • tst_qquicktextinput
Qt::Key_Right:
executed 6 times by 1 test: case Qt::Key_Right:
Executed by:
  • tst_qquicktextinput
6
1072 ke->accept();-
1073 return
executed 68 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 68 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
68
1074 default
executed 28 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
:
executed 28 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
28
1075 break;
executed 28 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
28
1076 }-
1077 }-
1078 }-
1079 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
84
1080-
1081-
1082 return
executed 7197 times by 5 tests: return QQuickImplicitSizeItem::event(ev);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
QQuickImplicitSizeItem::event(ev);
executed 7197 times by 5 tests: return QQuickImplicitSizeItem::event(ev);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
7197
1083}-
1084-
1085void QQuickTextInput::geometryChanged(const QRectF &newGeometry,-
1086 const QRectF &oldGeometry)-
1087{-
1088 QQuickTextInputPrivate * const d = d_func();-
1089 if (!d->inLayout
!d->inLayoutDescription
TRUEevaluated 3019 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-3019
1090 if (newGeometry.width() != oldGeometry.width()
newGeometry.wi...ometry.width()Description
TRUEevaluated 2686 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 333 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
333-2686
1091 d->updateLayout();
executed 2686 times by 5 tests: d->updateLayout();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
2686
1092 else if (newGeometry.height() != oldGeometry.height()
newGeometry.he...metry.height()Description
TRUEevaluated 282 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 51 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& d->vAlign != QQuickTextInput::AlignTop
d->vAlign != Q...nput::AlignTopDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 262 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
20-282
1093 d->updateBaselineOffset();
executed 20 times by 1 test: d->updateBaselineOffset();
Executed by:
  • tst_qquicktextinput
20
1094 updateCursorRectangle();-
1095 }
executed 3019 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
3019
1096 QQuickImplicitSizeItem::geometryChanged(newGeometry, oldGeometry);-
1097}
executed 3025 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
3025
1098-
1099void QQuickTextInputPrivate::ensureVisible(int position, int preeditCursor, int preeditLength)-
1100{-
1101 QQuickTextInput * const q = q_func();-
1102 QTextLine textLine = m_textLayout.lineForTextPosition(position + preeditCursor);-
1103 const qreal width = qMax<qreal>(0, q->width() - q->leftPadding() - q->rightPadding());-
1104 qreal cix = 0;-
1105 qreal widthUsed = 0;-
1106 if (textLine.isValid()
textLine.isValid()Description
TRUEevaluated 8395 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicktextinput
) {
10-8395
1107 cix = textLine.cursorToX(position + preeditLength);-
1108 const qreal cursorWidth = cix >= 0
cix >= 0Description
TRUEevaluated 8331 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
? cix : width - cix;
64-8331
1109 widthUsed = qMax(textLine.naturalTextWidth(), cursorWidth);-
1110 }
executed 8395 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
8395
1111 int previousScroll = hscroll;-
1112-
1113 if (widthUsed <= width
widthUsed <= widthDescription
TRUEevaluated 8091 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 314 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
314-8091
1114 hscroll = 0;-
1115 }
executed 8091 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
else {
8091
1116 ((textLine.isValid()) ? static_cast<void>(0) : qt_assert("textLine.isValid()", __FILE__, 1754));-
1117 if (cix - hscroll >= width
cix - hscroll >= widthDescription
TRUEevaluated 138 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
138-176
1118-
1119 hscroll = cix - width;-
1120 }
executed 138 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
else if (cix - hscroll < 0
cix - hscroll < 0Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 104 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
&& hscroll < widthUsed
hscroll < widthUsedDescription
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-138
1121-
1122 hscroll = cix;-
1123 }
executed 70 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
else if (widthUsed - hscroll < width
widthUsed - hscroll < widthDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
10-96
1124-
1125-
1126 hscroll = widthUsed - width;-
1127 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (width - hscroll > widthUsed
width - hscroll > widthUsedDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
8-88
1128-
1129-
1130 hscroll = width - widthUsed;-
1131 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
1132-
1133 if (preeditLength > 0
preeditLength > 0Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 288 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
) {
26-288
1134-
1135-
1136 cix = textLine.cursorToX(position + qMax(0, preeditCursor - 1));-
1137 if (cix < hscroll
cix < hscrollDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
10-16
1138 hscroll = cix;
executed 10 times by 1 test: hscroll = cix;
Executed by:
  • tst_qquicktextinput
10
1139 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
26
1140-
1141 }
executed 314 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
314
1142 if (previousScroll != hscroll
previousScroll != hscrollDescription
TRUEevaluated 208 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 8197 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
208-8197
1143 textLayoutDirty = true;
executed 208 times by 2 tests: textLayoutDirty = true;
Executed by:
  • tst_examples
  • tst_qquicktextinput
208
1144}
executed 8405 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
8405
1145-
1146void QQuickTextInputPrivate::updateHorizontalScroll()-
1147{-
1148 if (autoScroll
autoScrollDescription
TRUEevaluated 8411 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_echoMode != QQuickTextInput::NoEcho
m_echoMode != ...tInput::NoEchoDescription
TRUEevaluated 8401 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
10-8411
1149-
1150 const int preeditLength = m_textLayout.preeditAreaText().length();-
1151 ensureVisible(m_cursor, m_preeditCursor, preeditLength);-
1152-
1153-
1154-
1155 }
executed 8401 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
else {
8401
1156 hscroll = 0;-
1157 }
executed 132 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
132
1158}-
1159-
1160void QQuickTextInputPrivate::updateVerticalScroll()-
1161{-
1162 QQuickTextInput * const q = q_func();-
1163-
1164 const int preeditLength = m_textLayout.preeditAreaText().length();-
1165-
1166 const qreal height = qMax<qreal>(0, q->height() - q->topPadding() - q->bottomPadding());-
1167 qreal heightUsed = contentSize.height();-
1168 qreal previousScroll = vscroll;-
1169-
1170 if (!autoScroll
!autoScrollDescription
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 8411 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
|| heightUsed <= height
heightUsed <= heightDescription
TRUEevaluated 8153 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 258 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
122-8411
1171-
1172 vscroll = -QQuickTextUtil::alignedY(-
1173 heightUsed, height, vAlign & ~(Qt::AlignAbsolute|Qt::AlignHorizontal_Mask));-
1174 }
executed 8275 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
else {
8275
1175-
1176 QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor + preeditLength);-
1177-
1178-
1179-
1180 QRectF r = currentLine.isValid()
currentLine.isValid()Description
TRUEevaluated 258 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
? currentLine.rect() : QRectF();
0-258
1181 qreal top = r.top();-
1182 int bottom = r.bottom();-
1183-
1184 if (bottom - vscroll >= height
bottom - vscroll >= heightDescription
TRUEevaluated 162 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
96-162
1185-
1186 vscroll = bottom - height;-
1187 }
executed 162 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (top - vscroll < 0
top - vscroll < 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& vscroll < heightUsed
vscroll < heightUsedDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-162
1188-
1189 vscroll = top;-
1190 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (heightUsed - vscroll < height
heightUsed - vscroll < heightDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-74
1191-
1192-
1193 vscroll = heightUsed - height;-
1194 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
1195-
1196 if (preeditLength > 0
preeditLength > 0Description
TRUEnever evaluated
FALSEevaluated 258 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-258
1197-
1198-
1199 currentLine = m_textLayout.lineForTextPosition(m_cursor + qMax(0, m_preeditCursor - 1));-
1200 top = currentLine.isValid()
currentLine.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
? currentLine.rect().top() : 0;
0
1201 if (top < vscroll
top < vscrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1202 vscroll = top;
never executed: vscroll = top;
0
1203 }
never executed: end of block
0
1204-
1205 }
executed 258 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
258
1206 if (previousScroll != vscroll
previousScroll != vscrollDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 8459 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
74-8459
1207 textLayoutDirty = true;
executed 74 times by 1 test: textLayoutDirty = true;
Executed by:
  • tst_qquicktextinput
74
1208}
executed 8533 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
8533
1209-
1210void QQuickTextInput::triggerPreprocess()-
1211{-
1212 QQuickTextInputPrivate * const d = d_func();-
1213 if (d->updateType == QQuickTextInputPrivate::UpdateNone
d->updateType ...te::UpdateNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1214 d->updateType = QQuickTextInputPrivate::UpdateOnlyPreprocess;
never executed: d->updateType = QQuickTextInputPrivate::UpdateOnlyPreprocess;
0
1215 polish();-
1216 update();-
1217}
never executed: end of block
0
1218-
1219void QQuickTextInput::updatePolish()-
1220{-
1221 invalidateFontCaches();-
1222}
executed 302 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
302
1223-
1224void QQuickTextInput::invalidateFontCaches()-
1225{-
1226 QQuickTextInputPrivate * const d = d_func();-
1227-
1228 if (d->m_textLayout.engine() != nullptr
d->m_textLayou...e() != nullptrDescription
TRUEevaluated 599 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
)
0-599
1229 d->m_textLayout.engine()->resetFontEngineCache();
executed 599 times by 4 tests: d->m_textLayout.engine()->resetFontEngineCache();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
599
1230}
executed 599 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
599
1231-
1232void QQuickTextInput::ensureActiveFocus()-
1233{-
1234 bool hadActiveFocus = hasActiveFocus();-
1235 forceActiveFocus();-
1236-
1237 QQuickTextInputPrivate * const d = d_func();-
1238-
1239 if (hasActiveFocus()
hasActiveFocus()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& hadActiveFocus
hadActiveFocusDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-62
1240 (static_cast<
executed 36 times by 1 test: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
Executed by:
  • tst_qquicktextinput
QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
executed 36 times by 1 test: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
Executed by:
  • tst_qquicktextinput
36
1241-
1242-
1243-
1244}
executed 64 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
64
1245-
1246QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)-
1247{-
1248 (void)data;;-
1249 QQuickTextInputPrivate * const d = d_func();-
1250-
1251 if (d->updateType != QQuickTextInputPrivate::UpdatePaintNode
d->updateType ...pdatePaintNodeDescription
TRUEnever evaluated
FALSEevaluated 297 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& oldNode != nullptr
oldNode != nullptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-297
1252-
1253 d->updateType = QQuickTextInputPrivate::UpdateNone;-
1254 return
never executed: return oldNode;
oldNode;
never executed: return oldNode;
0
1255 }-
1256-
1257 d->updateType = QQuickTextInputPrivate::UpdateNone;-
1258-
1259 QQuickTextNode *node = static_cast<QQuickTextNode *>(oldNode);-
1260 if (node == nullptr
node == nullptrDescription
TRUEevaluated 162 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 135 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
135-162
1261 node = new QQuickTextNode(this);
executed 162 times by 4 tests: node = new QQuickTextNode(this);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
162
1262 d->textNode = node;-
1263-
1264 const bool showCursor = !isReadOnly()
!isReadOnly()Description
TRUEevaluated 267 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
&& d->cursorItem == nullptr
d->cursorItem == nullptrDescription
TRUEevaluated 236 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& d->cursorVisible
d->cursorVisibleDescription
TRUEevaluated 69 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 167 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& d->m_blinkStatus
d->m_blinkStatusDescription
TRUEevaluated 66 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
3-267
1265-
1266 if (!d->textLayoutDirty
!d->textLayoutDirtyDescription
TRUEevaluated 86 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 211 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& oldNode != nullptr
oldNode != nullptrDescription
TRUEevaluated 86 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-211
1267 if (showCursor
showCursorDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
)
26-60
1268 node->setCursor(cursorRectangle(), d->color);
executed 26 times by 3 tests: node->setCursor(cursorRectangle(), d->color);
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
26
1269 else-
1270 node->clearCursor();
executed 60 times by 2 tests: node->clearCursor();
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
60
1271 } else {-
1272 node->setUseNativeRenderer(d->renderType == NativeRendering);-
1273 node->deleteContent();-
1274 node->setMatrix(QMatrix4x4());-
1275-
1276 QPointF offset(leftPadding(), topPadding());-
1277 if (d->autoScroll
d->autoScrollDescription
TRUEevaluated 209 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& d->m_textLayout.lineCount() > 0
d->m_textLayou...ineCount() > 0Description
TRUEevaluated 209 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-209
1278 QFontMetricsF fm(d->font);-
1279-
1280 offset += -QPointF(d->hscroll, d->vscroll + d->m_textLayout.lineAt(0).ascent() - fm.ascent());-
1281 }
executed 209 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
else {
209
1282 offset += -QPointF(d->hscroll, d->vscroll);-
1283 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
1284-
1285 if (!d->m_textLayout.text().isEmpty()
!d->m_textLayo...xt().isEmpty()Description
TRUEevaluated 145 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 66 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
66-145
1286-
1287 || !d->m_textLayout.preeditAreaText().isEmpty()
!d->m_textLayo...xt().isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 64 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
2-64
1288-
1289 ) {-
1290 node->addTextLayout(offset, &d->m_textLayout, d->color,-
1291 QQuickText::Normal, QColor(), QColor(),-
1292 d->selectionColor, d->selectedTextColor,-
1293 d->selectionStart(),-
1294 d->selectionEnd() - 1);-
1295-
1296 }
executed 147 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
147
1297-
1298 if (showCursor
showCursorDescription
TRUEevaluated 40 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 171 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
40-171
1299 node->setCursor(cursorRectangle(), d->color);
executed 40 times by 2 tests: node->setCursor(cursorRectangle(), d->color);
Executed by:
  • tst_examples
  • tst_qquicktextinput
40
1300-
1301 d->textLayoutDirty = false;-
1302 }
executed 211 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
211
1303-
1304 invalidateFontCaches();-
1305-
1306 return
executed 297 times by 4 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
node;
executed 297 times by 4 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
297
1307}-
1308-
1309-
1310QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property) const-
1311{-
1312 return
executed 1279 times by 3 tests: return inputMethodQuery(property, QVariant());
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
inputMethodQuery(property, QVariant());
executed 1279 times by 3 tests: return inputMethodQuery(property, QVariant());
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1279
1313}-
1314-
1315QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const-
1316{-
1317 const QQuickTextInputPrivate * const d = d_func();-
1318 switch (property) {-
1319 case
executed 531 times by 3 tests: case Qt::ImEnabled:
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
Qt::ImEnabled:
executed 531 times by 3 tests: case Qt::ImEnabled:
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
531
1320 return
executed 531 times by 3 tests: return QVariant((bool)(flags() & ItemAcceptsInputMethod));
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
QVariant((bool)(flags() & ItemAcceptsInputMethod));
executed 531 times by 3 tests: return QVariant((bool)(flags() & ItemAcceptsInputMethod));
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
531
1321 case
executed 396 times by 3 tests: case Qt::ImHints:
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
Qt::ImHints:
executed 396 times by 3 tests: case Qt::ImHints:
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
396
1322 return
executed 396 times by 3 tests: return QVariant((int) d->effectiveInputMethodHints());
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
QVariant((int) d->effectiveInputMethodHints());
executed 396 times by 3 tests: return QVariant((int) d->effectiveInputMethodHints());
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
396
1323 case
executed 344 times by 1 test: case Qt::ImCursorRectangle:
Executed by:
  • tst_qquicktextinput
Qt::ImCursorRectangle:
executed 344 times by 1 test: case Qt::ImCursorRectangle:
Executed by:
  • tst_qquicktextinput
344
1324 return
executed 344 times by 1 test: return cursorRectangle();
Executed by:
  • tst_qquicktextinput
cursorRectangle();
executed 344 times by 1 test: return cursorRectangle();
Executed by:
  • tst_qquicktextinput
344
1325 case
never executed: case Qt::ImAnchorRectangle:
Qt::ImAnchorRectangle:
never executed: case Qt::ImAnchorRectangle:
0
1326 return
never executed: return d->anchorRectangle();
d->anchorRectangle();
never executed: return d->anchorRectangle();
0
1327 case
never executed: case Qt::ImFont:
Qt::ImFont:
never executed: case Qt::ImFont:
0
1328 return
never executed: return font();
font();
never executed: return font();
0
1329 case
never executed: case Qt::ImCursorPosition:
Qt::ImCursorPosition:
never executed: case Qt::ImCursorPosition:
{
0
1330 const QPointF pt = argument.toPointF();-
1331 if (!pt.isNull()
!pt.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1332 return
never executed: return QVariant(d->positionAt(pt));
QVariant(d->positionAt(pt));
never executed: return QVariant(d->positionAt(pt));
0
1333 return
never executed: return QVariant(d->m_cursor);
QVariant(d->m_cursor);
never executed: return QVariant(d->m_cursor);
0
1334 }-
1335 case
executed 8 times by 1 test: case Qt::ImSurroundingText:
Executed by:
  • tst_qquicktextinput
Qt::ImSurroundingText:
executed 8 times by 1 test: case Qt::ImSurroundingText:
Executed by:
  • tst_qquicktextinput
8
1336 if (d->m_echoMode == PasswordEchoOnEdit
d->m_echoMode ...wordEchoOnEditDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !d->m_passwordEchoEditing
!d->m_passwordEchoEditingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-8
1337 return
executed 4 times by 1 test: return QVariant(displayText());
Executed by:
  • tst_qquicktextinput
QVariant(displayText());
executed 4 times by 1 test: return QVariant(displayText());
Executed by:
  • tst_qquicktextinput
4
1338 } else {-
1339 return
executed 4 times by 1 test: return QVariant(d->realText());
Executed by:
  • tst_qquicktextinput
QVariant(d->realText());
executed 4 times by 1 test: return QVariant(d->realText());
Executed by:
  • tst_qquicktextinput
4
1340 }-
1341 case
never executed: case Qt::ImCurrentSelection:
Qt::ImCurrentSelection:
never executed: case Qt::ImCurrentSelection:
0
1342 return
never executed: return QVariant(selectedText());
QVariant(selectedText());
never executed: return QVariant(selectedText());
0
1343 case
never executed: case Qt::ImMaximumTextLength:
Qt::ImMaximumTextLength:
never executed: case Qt::ImMaximumTextLength:
0
1344 return
never executed: return QVariant(maxLength());
QVariant(maxLength());
never executed: return QVariant(maxLength());
0
1345 case
never executed: case Qt::ImAnchorPosition:
Qt::ImAnchorPosition:
never executed: case Qt::ImAnchorPosition:
0
1346 if (d->selectionStart() == d->selectionEnd()
d->selectionSt...selectionEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1347 return
never executed: return QVariant(d->m_cursor);
QVariant(d->m_cursor);
never executed: return QVariant(d->m_cursor);
0
1348 else if (d->selectionStart() == d->m_cursor
d->selectionSt...== d->m_cursorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1349 return
never executed: return QVariant(d->selectionEnd());
QVariant(d->selectionEnd());
never executed: return QVariant(d->selectionEnd());
0
1350 else-
1351 return
never executed: return QVariant(d->selectionStart());
QVariant(d->selectionStart());
never executed: return QVariant(d->selectionStart());
0
1352 case
never executed: case Qt::ImAbsolutePosition:
Qt::ImAbsolutePosition:
never executed: case Qt::ImAbsolutePosition:
0
1353 return
never executed: return QVariant(d->m_cursor);
QVariant(d->m_cursor);
never executed: return QVariant(d->m_cursor);
0
1354 case
never executed: case Qt::ImTextAfterCursor:
Qt::ImTextAfterCursor:
never executed: case Qt::ImTextAfterCursor:
0
1355 if (argument.isValid()
argument.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1356 return
never executed: return QVariant(d->m_text.mid(d->m_cursor, argument.toInt()));
QVariant(d->m_text.mid(d->m_cursor, argument.toInt()));
never executed: return QVariant(d->m_text.mid(d->m_cursor, argument.toInt()));
0
1357 return
never executed: return QVariant(d->m_text.mid(d->m_cursor));
QVariant(d->m_text.mid(d->m_cursor));
never executed: return QVariant(d->m_text.mid(d->m_cursor));
0
1358 case
never executed: case Qt::ImTextBeforeCursor:
Qt::ImTextBeforeCursor:
never executed: case Qt::ImTextBeforeCursor:
0
1359 if (argument.isValid()
argument.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1360 return
never executed: return QVariant(d->m_text.leftRef(d->m_cursor).right(argument.toInt()).toString());
QVariant(d->m_text.leftRef(d->m_cursor).right(argument.toInt()).toString());
never executed: return QVariant(d->m_text.leftRef(d->m_cursor).right(argument.toInt()).toString());
0
1361 return
never executed: return QVariant(d->m_text.left(d->m_cursor));
QVariant(d->m_text.left(d->m_cursor));
never executed: return QVariant(d->m_text.left(d->m_cursor));
0
1362 default
never executed: default:
:
never executed: default:
0
1363 return
never executed: return QQuickItem::inputMethodQuery(property);
QQuickItem::inputMethodQuery(property);
never executed: return QQuickItem::inputMethodQuery(property);
0
1364 }-
1365}-
1366-
1367-
1368-
1369-
1370-
1371-
1372-
1373void QQuickTextInput::deselect()-
1374{-
1375 QQuickTextInputPrivate * const d = d_func();-
1376 d->deselect();-
1377}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1378-
1379-
1380-
1381-
1382-
1383-
1384void QQuickTextInput::selectAll()-
1385{-
1386 QQuickTextInputPrivate * const d = d_func();-
1387 d->setSelection(0, text().length());-
1388}
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
20
1389-
1390-
1391-
1392-
1393-
1394-
1395-
1396bool QQuickTextInput::isRightToLeft(int start, int end)-
1397{-
1398 if (start > end
start > endDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-164
1399 qmlWarning(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";-
1400 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
4
1401 } else {-
1402 return
executed 164 times by 1 test: return text().midRef(start, end - start).isRightToLeft();
Executed by:
  • tst_qquicktextinput
text().midRef(start, end - start).isRightToLeft();
executed 164 times by 1 test: return text().midRef(start, end - start).isRightToLeft();
Executed by:
  • tst_qquicktextinput
164
1403 }-
1404}-
1405void QQuickTextInput::cut()-
1406{-
1407 QQuickTextInputPrivate * const d = d_func();-
1408 if (!d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& d->m_echoMode == QQuickTextInput::Normal
d->m_echoMode ...tInput::NormalDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-8
1409 d->copy();-
1410 d->del();-
1411 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
1412}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
1413void QQuickTextInput::copy()-
1414{-
1415 QQuickTextInputPrivate * const d = d_func();-
1416 d->copy();-
1417}
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
1418-
1419-
1420-
1421-
1422-
1423-
1424void QQuickTextInput::paste()-
1425{-
1426 QQuickTextInputPrivate * const d = d_func();-
1427 if (!d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-6
1428 d->paste();
executed 6 times by 1 test: d->paste();
Executed by:
  • tst_qquicktextinput
6
1429}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
1430void QQuickTextInput::undo()-
1431{-
1432 QQuickTextInputPrivate * const d = d_func();-
1433 if (!d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-164
1434 d->resetInputMethod();-
1435 d->internalUndo();-
1436 d->finishChange(-1, true);-
1437 }
executed 164 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
164
1438}
executed 164 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
164
1439-
1440-
1441-
1442-
1443-
1444-
1445-
1446void QQuickTextInput::redo()-
1447{-
1448 QQuickTextInputPrivate * const d = d_func();-
1449 if (!d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-12
1450 d->resetInputMethod();-
1451 d->internalRedo();-
1452 d->finishChange();-
1453 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
1454}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
1455-
1456-
1457-
1458-
1459-
1460-
1461-
1462void QQuickTextInput::insert(int position, const QString &text)-
1463{-
1464 QQuickTextInputPrivate * const d = d_func();-
1465 if (d->m_echoMode == QQuickTextInput::Password
d->m_echoMode ...nput::PasswordDescription
TRUEnever evaluated
FALSEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-126
1466 if (d->m_passwordMaskDelay > 0
d->m_passwordMaskDelay > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1467 d->m_passwordEchoTimer.start(d->m_passwordMaskDelay, this);
never executed: d->m_passwordEchoTimer.start(d->m_passwordMaskDelay, this);
0
1468 }
never executed: end of block
0
1469 if (position < 0
position < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| position > d->m_text.length()
position > d->m_text.length()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-122
1470 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
6
1471-
1472 const int priorState = d->m_undoState;-
1473-
1474 QString insertText = text;-
1475-
1476 if (d->hasSelectedText()
d->hasSelectedText()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
24-96
1477 d->addCommand(QQuickTextInputPrivate::Command(-
1478 QQuickTextInputPrivate::SetSelection, d->m_cursor, 0, d->m_selstart, d->m_selend));-
1479 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
24
1480 if (d->m_maskData
d->m_maskDataDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
28-92
1481 insertText = d->maskString(position, insertText);-
1482 for (int i = 0; i < insertText.length()
i < insertText.length()Description
TRUEevaluated 538 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
92-538
1483 d->addCommand(QQuickTextInputPrivate::Command(-
1484 QQuickTextInputPrivate::DeleteSelection, position + i, d->m_text.at(position + i), -1, -1));-
1485 d->addCommand(QQuickTextInputPrivate::Command(-
1486 QQuickTextInputPrivate::Insert, position + i, insertText.at(i), -1, -1));-
1487 }
executed 538 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
538
1488 d->m_text.replace(position, insertText.length(), insertText);-
1489 if (!insertText.isEmpty()
!insertText.isEmpty()Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
10-82
1490 d->m_textDirty = true;
executed 82 times by 1 test: d->m_textDirty = true;
Executed by:
  • tst_qquicktextinput
82
1491 if (position < d->m_selend
position < d->m_selendDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& position + insertText.length() > d->m_selstart
position + ins... d->m_selstartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-84
1492 d->m_selDirty = true;
executed 4 times by 1 test: d->m_selDirty = true;
Executed by:
  • tst_qquicktextinput
4
1493 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
92
1494 int remaining = d->m_maxLength - d->m_text.length();-
1495 if (remaining != 0
remaining != 0Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-28
1496 insertText = insertText.left(remaining);-
1497 d->m_text.insert(position, insertText);-
1498 for (int i = 0; i < insertText.length()
i < insertText.length()Description
TRUEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i)
28-154
1499 d->addCommand(QQuickTextInputPrivate::Command(
executed 154 times by 1 test: d->addCommand(QQuickTextInputPrivate::Command( QQuickTextInputPrivate::Insert, position + i, insertText.at(i), -1, -1));
Executed by:
  • tst_qquicktextinput
154
1500 QQuickTextInputPrivate::Insert, position + i, insertText.at(i), -1, -1));
executed 154 times by 1 test: d->addCommand(QQuickTextInputPrivate::Command( QQuickTextInputPrivate::Insert, position + i, insertText.at(i), -1, -1));
Executed by:
  • tst_qquicktextinput
154
1501 if (d->m_cursor >= position
d->m_cursor >= positionDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
10-18
1502 d->m_cursor += insertText.length();
executed 18 times by 1 test: d->m_cursor += insertText.length();
Executed by:
  • tst_qquicktextinput
18
1503 if (d->m_selstart >= position
d->m_selstart >= positionDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
10-18
1504 d->m_selstart += insertText.length();
executed 10 times by 1 test: d->m_selstart += insertText.length();
Executed by:
  • tst_qquicktextinput
10
1505 if (d->m_selend >= position
d->m_selend >= positionDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
14
1506 d->m_selend += insertText.length();
executed 14 times by 1 test: d->m_selend += insertText.length();
Executed by:
  • tst_qquicktextinput
14
1507 d->m_textDirty = true;-
1508 if (position >= d->m_selstart
position >= d->m_selstartDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& position <= d->m_selend
position <= d->m_selendDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-18
1509 d->m_selDirty = true;
executed 4 times by 1 test: d->m_selDirty = true;
Executed by:
  • tst_qquicktextinput
4
1510 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
1511 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
1512-
1513 d->addCommand(QQuickTextInputPrivate::Command(-
1514 QQuickTextInputPrivate::SetSelection, d->m_cursor, 0, d->m_selstart, d->m_selend));-
1515 d->finishChange(priorState);-
1516-
1517 if (d->lastSelectionStart != d->lastSelectionEnd
d->lastSelecti...stSelectionEndDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
24-96
1518 if (d->m_selstart != d->lastSelectionStart
d->m_selstart ...SelectionStartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-20
1519 d->lastSelectionStart = d->m_selstart;-
1520 selectionStartChanged();-
1521 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1522 if (d->m_selend != d->lastSelectionEnd
d->m_selend !=...stSelectionEndDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-20
1523 d->lastSelectionEnd = d->m_selend;-
1524 selectionEndChanged();-
1525 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1526 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
24
1527}
executed 120 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
120
1528-
1529-
1530-
1531-
1532-
1533-
1534-
1535void QQuickTextInput::remove(int start, int end)-
1536{-
1537 QQuickTextInputPrivate * const d = d_func();-
1538-
1539 start = qBound(0, start, d->m_text.length());-
1540 end = qBound(0, end, d->m_text.length());-
1541-
1542 if (start > end
start > endDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-60
1543 qSwap(start, end);
executed 4 times by 1 test: qSwap(start, end);
Executed by:
  • tst_qquicktextinput
4
1544 else if (start == end
start == endDescription
TRUEnever evaluated
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-60
1545 return;
never executed: return;
0
1546-
1547 if (start < d->m_selend
start < d->m_selendDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& end > d->m_selstart
end > d->m_selstartDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
8-48
1548 d->m_selDirty = true;
executed 8 times by 1 test: d->m_selDirty = true;
Executed by:
  • tst_qquicktextinput
8
1549-
1550 const int priorState = d->m_undoState;-
1551-
1552 d->addCommand(QQuickTextInputPrivate::Command(-
1553 QQuickTextInputPrivate::SetSelection, d->m_cursor, 0, d->m_selstart, d->m_selend));-
1554-
1555 if (start <= d->m_cursor
start <= d->m_cursorDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& d->m_cursor < end
d->m_cursor < endDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
18-44
1556-
1557-
1558 for (int i = d->m_cursor; i >= start
i >= startDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i) {
18
1559 d->addCommand(QQuickTextInputPrivate::Command(-
1560 QQuickTextInputPrivate::DeleteSelection, i, d->m_text.at(i), -1, 1));-
1561 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
18
1562 for (int i = end - 1; i > d->m_cursor
i > d->m_cursorDescription
TRUEevaluated 162 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i) {
18-162
1563 d->addCommand(QQuickTextInputPrivate::Command(-
1564 QQuickTextInputPrivate::DeleteSelection, i - d->m_cursor + start - 1, d->m_text.at(i), -1, -1));-
1565 }
executed 162 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
162
1566 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
18
1567 for (int i = end - 1; i >= start
i >= startDescription
TRUEevaluated 212 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i) {
46-212
1568 d->addCommand(QQuickTextInputPrivate::Command(-
1569 QQuickTextInputPrivate::RemoveSelection, i, d->m_text.at(i), -1, -1));-
1570 }
executed 212 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
212
1571 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
46
1572 if (d->m_maskData
d->m_maskDataDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
26-38
1573 d->m_text.replace(start, end - start, d->clearString(start, end - start));-
1574 for (int i = 0; i < end - start
i < end - startDescription
TRUEevaluated 94 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
26-94
1575 d->addCommand(QQuickTextInputPrivate::Command(-
1576 QQuickTextInputPrivate::Insert, start + i, d->m_text.at(start + i), -1, -1));-
1577 }
executed 94 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
94
1578 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
26
1579 d->m_text.remove(start, end - start);-
1580-
1581 if (d->m_cursor > start
d->m_cursor > startDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
16-22
1582 d->m_cursor -= qMin(d->m_cursor, end) - start;
executed 16 times by 1 test: d->m_cursor -= qMin(d->m_cursor, end) - start;
Executed by:
  • tst_qquicktextinput
16
1583 if (d->m_selstart > start
d->m_selstart > startDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-34
1584 d->m_selstart -= qMin(d->m_selstart, end) - start;
executed 4 times by 1 test: d->m_selstart -= qMin(d->m_selstart, end) - start;
Executed by:
  • tst_qquicktextinput
4
1585 if (d->m_selend > end
d->m_selend > endDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
8-30
1586 d->m_selend -= qMin(d->m_selend, end) - start;
executed 8 times by 1 test: d->m_selend -= qMin(d->m_selend, end) - start;
Executed by:
  • tst_qquicktextinput
8
1587 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
38
1588 d->addCommand(QQuickTextInputPrivate::Command(-
1589 QQuickTextInputPrivate::SetSelection, d->m_cursor, 0, d->m_selstart, d->m_selend));-
1590-
1591 d->m_textDirty = true;-
1592 d->finishChange(priorState);-
1593-
1594 if (d->lastSelectionStart != d->lastSelectionEnd
d->lastSelecti...stSelectionEndDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
24-40
1595 if (d->m_selstart != d->lastSelectionStart
d->m_selstart ...SelectionStartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-20
1596 d->lastSelectionStart = d->m_selstart;-
1597 selectionStartChanged();-
1598 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1599 if (d->m_selend != d->lastSelectionEnd
d->m_selend !=...stSelectionEndDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-20
1600 d->lastSelectionEnd = d->m_selend;-
1601 selectionEndChanged();-
1602 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1603 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
24
1604}
executed 64 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
64
1605-
1606-
1607-
1608-
1609-
1610-
1611-
1612void QQuickTextInput::selectWord()-
1613{-
1614 QQuickTextInputPrivate * const d = d_func();-
1615 d->selectWordAtPos(d->m_cursor);-
1616}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1617QString QQuickTextInput::passwordCharacter() const-
1618{-
1619 const QQuickTextInputPrivate * const d = d_func();-
1620 return
executed 4 times by 1 test: return QString(d->m_passwordCharacter);
Executed by:
  • tst_qquicktextinput
QString(d->m_passwordCharacter);
executed 4 times by 1 test: return QString(d->m_passwordCharacter);
Executed by:
  • tst_qquicktextinput
4
1621}-
1622-
1623void QQuickTextInput::setPasswordCharacter(const QString &str)-
1624{-
1625 QQuickTextInputPrivate * const d = d_func();-
1626 if (str.length() < 1
str.length() < 1Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-6
1627 return;
never executed: return;
0
1628 d->m_passwordCharacter = str.constData()[0];-
1629 if (d->m_echoMode == Password
d->m_echoMode == PasswordDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
|| d->m_echoMode == PasswordEchoOnEdit
d->m_echoMode ...wordEchoOnEditDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-6
1630 d->updateDisplayText();
executed 6 times by 1 test: d->updateDisplayText();
Executed by:
  • tst_qquicktextinput
6
1631 passwordCharacterChanged();-
1632}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
1633int QQuickTextInput::passwordMaskDelay() const-
1634{-
1635 const QQuickTextInputPrivate * const d = d_func();-
1636 return
never executed: return d->m_passwordMaskDelay;
d->m_passwordMaskDelay;
never executed: return d->m_passwordMaskDelay;
0
1637}-
1638-
1639void QQuickTextInput::setPasswordMaskDelay(int delay)-
1640{-
1641 QQuickTextInputPrivate * const d = d_func();-
1642 if (d->m_passwordMaskDelay != delay
d->m_passwordM...Delay != delayDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1643 d->m_passwordMaskDelay = delay;-
1644 passwordMaskDelayChanged(delay);-
1645 }
never executed: end of block
0
1646}
never executed: end of block
0
1647-
1648void QQuickTextInput::resetPasswordMaskDelay()-
1649{-
1650 setPasswordMaskDelay((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->passwordMaskDelay());-
1651}
never executed: end of block
0
1652QString QQuickTextInput::displayText() const-
1653{-
1654 const QQuickTextInputPrivate * const d = d_func();-
1655 return
executed 176 times by 1 test: return d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());
Executed by:
  • tst_qquicktextinput
d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());
executed 176 times by 1 test: return d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());
Executed by:
  • tst_qquicktextinput
176
1656}-
1657QString QQuickTextInput::preeditText() const-
1658{-
1659 const QQuickTextInputPrivate * const d = d_func();-
1660 return
executed 8 times by 1 test: return d->m_textLayout.preeditAreaText();
Executed by:
  • tst_qquicktextinput
d->m_textLayout.preeditAreaText();
executed 8 times by 1 test: return d->m_textLayout.preeditAreaText();
Executed by:
  • tst_qquicktextinput
8
1661}-
1662bool QQuickTextInput::selectByMouse() const-
1663{-
1664 const QQuickTextInputPrivate * const d = d_func();-
1665 return
executed 6 times by 1 test: return d->selectByMouse;
Executed by:
  • tst_qquicktextinput
d->selectByMouse;
executed 6 times by 1 test: return d->selectByMouse;
Executed by:
  • tst_qquicktextinput
6
1666}-
1667-
1668void QQuickTextInput::setSelectByMouse(bool on)-
1669{-
1670 QQuickTextInputPrivate * const d = d_func();-
1671 if (d->selectByMouse != on
d->selectByMouse != onDescription
TRUEevaluated 40 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-40
1672 d->selectByMouse = on;-
1673 selectByMouseChanged(on);-
1674 }
executed 40 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
40
1675}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktextinput
42
1676QQuickTextInput::SelectionMode QQuickTextInput::mouseSelectionMode() const-
1677{-
1678 const QQuickTextInputPrivate * const d = d_func();-
1679 return
executed 6 times by 1 test: return d->mouseSelectionMode;
Executed by:
  • tst_qquicktextinput
d->mouseSelectionMode;
executed 6 times by 1 test: return d->mouseSelectionMode;
Executed by:
  • tst_qquicktextinput
6
1680}-
1681-
1682void QQuickTextInput::setMouseSelectionMode(SelectionMode mode)-
1683{-
1684 QQuickTextInputPrivate * const d = d_func();-
1685 if (d->mouseSelectionMode != mode
d->mouseSelectionMode != modeDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
8-10
1686 d->mouseSelectionMode = mode;-
1687 mouseSelectionModeChanged(mode);-
1688 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
1689}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
18
1690bool QQuickTextInput::persistentSelection() const-
1691{-
1692 const QQuickTextInputPrivate * const d = d_func();-
1693 return
executed 6 times by 1 test: return d->persistentSelection;
Executed by:
  • tst_qquicktextinput
d->persistentSelection;
executed 6 times by 1 test: return d->persistentSelection;
Executed by:
  • tst_qquicktextinput
6
1694}-
1695-
1696void QQuickTextInput::setPersistentSelection(bool on)-
1697{-
1698 QQuickTextInputPrivate * const d = d_func();-
1699 if (d->persistentSelection == on
d->persistentSelection == onDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2
1700 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
1701 d->persistentSelection = on;-
1702 persistentSelectionChanged();-
1703}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
1704-
1705-
1706-
1707-
1708-
1709-
1710-
1711bool QQuickTextInput::canPaste() const-
1712{-
1713-
1714 const QQuickTextInputPrivate * const d = d_func();-
1715 if (!d->canPasteValid
!d->canPasteValidDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-32
1716 if (const
const QMimeDat...()->mimeData()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
QMimeData *mimeData = QGuiApplication::clipboard()->mimeData()
const QMimeDat...()->mimeData()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-4
1717 const_cast<
executed 4 times by 1 test: const_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText();
Executed by:
  • tst_qquicktextinput
QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& mimeData->hasText()
mimeData->hasText()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
executed 4 times by 1 test: const_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText();
Executed by:
  • tst_qquicktextinput
0-4
1718 const_cast<QQuickTextInputPrivate *>(d)->canPasteValid = true;-
1719 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1720 return
executed 36 times by 1 test: return d->canPaste;
Executed by:
  • tst_qquicktextinput
d->canPaste;
executed 36 times by 1 test: return d->canPaste;
Executed by:
  • tst_qquicktextinput
36
1721-
1722-
1723-
1724}-
1725bool QQuickTextInput::canUndo() const-
1726{-
1727 const QQuickTextInputPrivate * const d = d_func();-
1728 return
executed 100 times by 1 test: return d->canUndo;
Executed by:
  • tst_qquicktextinput
d->canUndo;
executed 100 times by 1 test: return d->canUndo;
Executed by:
  • tst_qquicktextinput
100
1729}-
1730bool QQuickTextInput::canRedo() const-
1731{-
1732 const QQuickTextInputPrivate * const d = d_func();-
1733 return
executed 28 times by 1 test: return d->canRedo;
Executed by:
  • tst_qquicktextinput
d->canRedo;
executed 28 times by 1 test: return d->canRedo;
Executed by:
  • tst_qquicktextinput
28
1734}-
1735qreal QQuickTextInput::contentWidth() const-
1736{-
1737 const QQuickTextInputPrivate * const d = d_func();-
1738 return
executed 136 times by 1 test: return d->contentSize.width();
Executed by:
  • tst_qquicktextinput
d->contentSize.width();
executed 136 times by 1 test: return d->contentSize.width();
Executed by:
  • tst_qquicktextinput
136
1739}-
1740qreal QQuickTextInput::contentHeight() const-
1741{-
1742 const QQuickTextInputPrivate * const d = d_func();-
1743 return
executed 194 times by 1 test: return d->contentSize.height();
Executed by:
  • tst_qquicktextinput
d->contentSize.height();
executed 194 times by 1 test: return d->contentSize.height();
Executed by:
  • tst_qquicktextinput
194
1744}-
1745-
1746void QQuickTextInput::moveCursorSelection(int position)-
1747{-
1748 QQuickTextInputPrivate * const d = d_func();-
1749 d->moveCursor(position, true);-
1750}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
1751void QQuickTextInput::moveCursorSelection(int pos, SelectionMode mode)-
1752{-
1753 QQuickTextInputPrivate * const d = d_func();-
1754-
1755 if (mode == SelectCharacters
mode == SelectCharactersDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 302 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
82-302
1756 d->moveCursor(pos, true);-
1757 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (pos != d->m_cursor
pos != d->m_cursorDescription
TRUEevaluated 250 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicktextinput
){
52-250
1758 const int cursor = d->m_cursor;-
1759 int anchor;-
1760 if (!d->hasSelectedText()
!d->hasSelectedText()Description
TRUEevaluated 194 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
56-194
1761 anchor = d->m_cursor;
executed 194 times by 1 test: anchor = d->m_cursor;
Executed by:
  • tst_qquicktextinput
194
1762 else if (d->selectionStart() == d->m_cursor
d->selectionSt...== d->m_cursorDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
28
1763 anchor = d->selectionEnd();
executed 28 times by 1 test: anchor = d->selectionEnd();
Executed by:
  • tst_qquicktextinput
28
1764 else-
1765 anchor = d->selectionStart();
executed 28 times by 1 test: anchor = d->selectionStart();
Executed by:
  • tst_qquicktextinput
28
1766-
1767 if (anchor < pos
anchor < posDescription
TRUEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| (anchor == pos
anchor == posDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 118 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& cursor < pos
cursor < posDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)) {
4-126
1768 const QString text = this->text();-
1769 QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);-
1770 finder.setPosition(anchor);-
1771-
1772 const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();-
1773 if (anchor < text.length()
anchor < text.length()Description
TRUEevaluated 126 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (reasons == QTextBoundaryFinder::NotAtBoundary
reasons == QTe...:NotAtBoundaryDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-126
1774 || (reasons & QTextBoundaryFinder::EndOfItem))) {-
1775 finder.toPreviousBoundary();-
1776 }
executed 78 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
78
1777 anchor = finder.position() != -1
finder.position() != -1Description
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
? finder.position() : 0;
0-128
1778-
1779 finder.setPosition(pos);-
1780 if (pos > 0
pos > 0Description
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !finder.boundaryReasons()
!finder.boundaryReasons()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-128
1781 finder.toNextBoundary();
executed 62 times by 1 test: finder.toNextBoundary();
Executed by:
  • tst_qquicktextinput
62
1782 const int cursor = finder.position() != -1
finder.position() != -1Description
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
? finder.position() : text.length();
0-128
1783-
1784 d->setSelection(anchor, cursor - anchor);-
1785 }
executed 128 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (anchor > pos
anchor > posDescription
TRUEevaluated 118 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| (anchor == pos
anchor == posDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& cursor > pos
cursor > posDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-128
1786 const QString text = this->text();-
1787 QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);-
1788 finder.setPosition(anchor);-
1789-
1790 const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();-
1791 if (anchor > 0
anchor > 0Description
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& (reasons == QTextBoundaryFinder::NotAtBoundary
reasons == QTe...:NotAtBoundaryDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-120
1792 || (reasons & QTextBoundaryFinder::StartOfItem))) {-
1793 finder.toNextBoundary();-
1794 }
executed 74 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
74
1795 anchor = finder.position() != -1
finder.position() != -1Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
? finder.position() : text.length();
0-122
1796-
1797 finder.setPosition(pos);-
1798 if (pos < text.length()
pos < text.length()Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !finder.boundaryReasons()
!finder.boundaryReasons()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-122
1799 finder.toPreviousBoundary();
executed 36 times by 1 test: finder.toPreviousBoundary();
Executed by:
  • tst_qquicktextinput
36
1800 const int cursor = finder.position() != -1
finder.position() != -1Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
? finder.position() : 0;
0-122
1801-
1802 d->setSelection(anchor, cursor - anchor);-
1803 }
executed 122 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
122
1804 }
executed 250 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
250
1805}
executed 384 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
384
1806-
1807void QQuickTextInput::focusInEvent(QFocusEvent *event)-
1808{-
1809 QQuickTextInputPrivate * const d = d_func();-
1810 d->handleFocusEvent(event);-
1811 QQuickImplicitSizeItem::focusInEvent(event);-
1812}
executed 384 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
384
1813-
1814void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)-
1815{-
1816 QQuickTextInput * const q = q_func();-
1817 bool focus = event->gotFocus();-
1818 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 502 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
20-502
1819 q->setCursorVisible(focus);-
1820 setBlinkingCursorEnabled(focus);-
1821 }
executed 502 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
502
1822 if (focus
focusDescription
TRUEevaluated 384 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 138 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
138-384
1823 q->q_updateAlignment();-
1824-
1825 if (focusOnPress
focusOnPressDescription
TRUEevaluated 382 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_readOnly
!m_readOnlyDescription
TRUEevaluated 372 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
)
2-382
1826 (static_cast<
executed 372 times by 3 tests: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
executed 372 times by 3 tests: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
372
1827 q->connect(QGuiApplication::inputMethod(), qFlagLocation("2""inputDirectionChanged(Qt::LayoutDirection)" "\0" __FILE__ ":" "2647"),-
1828 q, qFlagLocation("1""q_updateAlignment()" "\0" __FILE__ ":" "2648"));-
1829-
1830 }
executed 384 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
else {
384
1831 if ((m_passwordEchoEditing
m_passwordEchoEditingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 134 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
|| m_passwordEchoTimer.isActive()
m_passwordEchoTimer.isActive()Description
TRUEnever evaluated
FALSEevaluated 134 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)) {
0-134
1832 updatePasswordEchoEditing(false);-
1833 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
1834-
1835 if (event->reason() != Qt::ActiveWindowFocusReason
event->reason(...dowFocusReasonDescription
TRUEevaluated 134 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
4-134
1836 && event->reason() != Qt::PopupFocusReason
event->reason(...pupFocusReasonDescription
TRUEevaluated 134 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
0-134
1837 && hasSelectedText()
hasSelectedText()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
8-126
1838 && !persistentSelection
!persistentSelectionDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-6
1839 deselect();
executed 6 times by 1 test: deselect();
Executed by:
  • tst_qquicktextinput
6
1840-
1841 if (hasAcceptableInput(m_text) == AcceptableInput
hasAcceptableI...cceptableInputDescription
TRUEevaluated 136 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| fixup()
fixup()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-136
1842 q->editingFinished();
executed 138 times by 3 tests: q->editingFinished();
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
138
1843-
1844-
1845 q->disconnect(QGuiApplication::inputMethod(), qFlagLocation("2""inputDirectionChanged(Qt::LayoutDirection)" "\0" __FILE__ ":" "2665"),-
1846 q, qFlagLocation("1""q_updateAlignment()" "\0" __FILE__ ":" "2666"));-
1847-
1848 }
executed 138 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
138
1849}-
1850-
1851void QQuickTextInput::focusOutEvent(QFocusEvent *event)-
1852{-
1853 QQuickTextInputPrivate * const d = d_func();-
1854 d->handleFocusEvent(event);-
1855 QQuickImplicitSizeItem::focusOutEvent(event);-
1856}
executed 138 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
138
1857bool QQuickTextInput::isInputMethodComposing() const-
1858{-
1859-
1860-
1861-
1862 const QQuickTextInputPrivate * const d = d_func();-
1863 return
executed 24 times by 1 test: return d->hasImState;
Executed by:
  • tst_qquicktextinput
d->hasImState;
executed 24 times by 1 test: return d->hasImState;
Executed by:
  • tst_qquicktextinput
24
1864-
1865}-
1866-
1867QQuickTextInputPrivate::ExtraData::ExtraData()-
1868 : padding(0)-
1869 , topPadding(0)-
1870 , leftPadding(0)-
1871 , rightPadding(0)-
1872 , bottomPadding(0)-
1873 , explicitTopPadding(false)-
1874 , explicitLeftPadding(false)-
1875 , explicitRightPadding(false)-
1876 , explicitBottomPadding(false)-
1877 , implicitResize(true)-
1878{-
1879}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
18
1880-
1881void QQuickTextInputPrivate::init()-
1882{-
1883 QQuickTextInput * const q = q_func();-
1884-
1885 if (QGuiApplication::clipboard()->supportsSelection()
QGuiApplicatio...rtsSelection()Description
TRUEevaluated 1042 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
)
0-1042
1886 q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
executed 1042 times by 5 tests: q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1042
1887 else-
1888-
1889 q->setAcceptedMouseButtons(Qt::LeftButton);
never executed: q->setAcceptedMouseButtons(Qt::LeftButton);
0
1890-
1891-
1892 q->setFlag(QQuickItem::ItemAcceptsInputMethod);-
1893-
1894 q->setFlag(QQuickItem::ItemHasContents);-
1895-
1896 { QClipboard *sender = (QGuiApplication::clipboard()); QQuickTextInput *receiver = (q); const char *signal = (qFlagLocation("2""dataChanged()" "\0" __FILE__ ":" "2730")); const char *method = (qFlagLocation("1""q_canPasteChanged()" "\0" __FILE__ ":" "2730")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 1032 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
10-1032
1897 __FILE__-
1898 ,-
1899 2730-
1900 )); signalIdx = QClipboard::staticMetaObject.indexOfSignal(signal+1); }
executed 10 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 1032 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
10-1032
1901 __FILE__-
1902 ,-
1903 2730-
1904 )); if (code == 1
code == 1Description
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
) methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
executed 10 times by 5 tests: methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-10
1905 __FILE__-
1906 ,-
1907 2730-
1908 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
1909 ;-
1910-
1911-
1912 lastSelectionStart = 0;-
1913 lastSelectionEnd = 0;-
1914 determineHorizontalAlignment();-
1915-
1916 if (!qmlDisableDistanceField()
!qmlDisableDistanceField()Description
TRUEevaluated 1042 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-1042
1917 QTextOption option = m_textLayout.textOption();-
1918 option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);-
1919 m_textLayout.setTextOption(option);-
1920 }
executed 1042 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1042
1921-
1922 m_inputControl = new QInputControl(QInputControl::LineEdit, q);-
1923}
executed 1042 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
1042
1924-
1925void QQuickTextInputPrivate::resetInputMethod()-
1926{-
1927 QQuickTextInput * const q = q_func();-
1928 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& q->hasActiveFocus()
q->hasActiveFocus()Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& (static_cast<
(static_cast<Q...::instance()))Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))
(static_cast<Q...::instance()))Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-182
1929 QGuiApplication::inputMethod()->reset();
executed 182 times by 1 test: QGuiApplication::inputMethod()->reset();
Executed by:
  • tst_qquicktextinput
182
1930}
executed 182 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
182
1931-
1932void QQuickTextInput::updateCursorRectangle(bool scroll)-
1933{-
1934 QQuickTextInputPrivate * const d = d_func();-
1935 if (!isComponentComplete()
!isComponentComplete()Description
TRUEevaluated 1344 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 8537 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
1344-8537
1936 return;
executed 1344 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1344
1937-
1938 if (scroll
scrollDescription
TRUEevaluated 8533 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-8533
1939 d->updateHorizontalScroll();-
1940 d->updateVerticalScroll();-
1941 }
executed 8533 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
8533
1942 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
1943 polish();-
1944 update();-
1945 cursorRectangleChanged();-
1946 if (d->cursorItem
d->cursorItemDescription
TRUEevaluated 954 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 7583 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
954-7583
1947 QRectF r = cursorRectangle();-
1948 d->cursorItem->setPosition(r.topLeft());-
1949 d->cursorItem->setHeight(r.height());-
1950 }
executed 954 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
954
1951-
1952 updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);-
1953-
1954}
executed 8537 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
8537
1955-
1956void QQuickTextInput::selectionChanged()-
1957{-
1958 QQuickTextInputPrivate * const d = d_func();-
1959 d->textLayoutDirty = true;-
1960 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
1961 polish();-
1962 update();-
1963 selectedTextChanged();-
1964-
1965 if (d->lastSelectionStart != d->selectionStart()
d->lastSelecti...lectionStart()Description
TRUEevaluated 740 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 262 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
262-740
1966 d->lastSelectionStart = d->selectionStart();-
1967 if (d->lastSelectionStart == -1
d->lastSelectionStart == -1Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
320-420
1968 d->lastSelectionStart = d->m_cursor;
executed 320 times by 1 test: d->lastSelectionStart = d->m_cursor;
Executed by:
  • tst_qquicktextinput
320
1969 selectionStartChanged();-
1970 }
executed 740 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
740
1971 if (d->lastSelectionEnd != d->selectionEnd()
d->lastSelecti...selectionEnd()Description
TRUEevaluated 782 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
220-782
1972 d->lastSelectionEnd = d->selectionEnd();-
1973 if (d->lastSelectionEnd == -1
d->lastSelectionEnd == -1Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 462 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
320-462
1974 d->lastSelectionEnd = d->m_cursor;
executed 320 times by 1 test: d->lastSelectionEnd = d->m_cursor;
Executed by:
  • tst_qquicktextinput
320
1975 selectionEndChanged();-
1976 }
executed 782 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
782
1977}
executed 1002 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1002
1978-
1979QRectF QQuickTextInput::boundingRect() const-
1980{-
1981 const QQuickTextInputPrivate * const d = d_func();-
1982-
1983 int cursorWidth = d->cursorItem
d->cursorItemDescription
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? 0 : 1;
58-92
1984-
1985 qreal hscroll = d->hscroll;-
1986 if (!d->autoScroll
!d->autoScrollDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 118 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| d->contentSize.width() < width()
d->contentSize...th() < width()Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
32-118
1987 hscroll -= QQuickTextUtil::alignedX(d->contentSize.width(), width(), effectiveHAlign());
executed 92 times by 1 test: hscroll -= QQuickTextUtil::alignedX(d->contentSize.width(), width(), effectiveHAlign());
Executed by:
  • tst_qquicktextinput
92
1988-
1989-
1990 QRectF r(-hscroll, -d->vscroll, d->contentSize.width(), d->contentSize.height());-
1991 r.setRight(r.right() + cursorWidth);-
1992 return
executed 150 times by 1 test: return r;
Executed by:
  • tst_qquicktextinput
r;
executed 150 times by 1 test: return r;
Executed by:
  • tst_qquicktextinput
150
1993}-
1994-
1995QRectF QQuickTextInput::clipRect() const-
1996{-
1997 const QQuickTextInputPrivate * const d = d_func();-
1998-
1999 int cursorWidth = d->cursorItem
d->cursorItemDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? d->cursorItem->width() : 1;
32-40
2000-
2001-
2002 QRectF r = QQuickImplicitSizeItem::clipRect();-
2003 r.setRight(r.right() + cursorWidth);-
2004 return
executed 72 times by 1 test: return r;
Executed by:
  • tst_qquicktextinput
r;
executed 72 times by 1 test: return r;
Executed by:
  • tst_qquicktextinput
72
2005}-
2006-
2007void QQuickTextInput::q_canPasteChanged()-
2008{-
2009 QQuickTextInputPrivate * const d = d_func();-
2010 bool old = d->canPaste;-
2011-
2012 if (const
const QMimeDat...()->mimeData()Description
TRUEevaluated 816 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
QMimeData *mimeData = QGuiApplication::clipboard()->mimeData()
const QMimeDat...()->mimeData()Description
TRUEevaluated 816 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
)
0-816
2013 d->canPaste = !d->m_readOnly
!d->m_readOnlyDescription
TRUEevaluated 792 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
&& mimeData->hasText()
mimeData->hasText()Description
TRUEevaluated 754 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
executed 816 times by 2 tests: d->canPaste = !d->m_readOnly && mimeData->hasText();
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
24-816
2014 else-
2015 d->canPaste = false;
never executed: d->canPaste = false;
0
2016-
2017-
2018 bool changed = d->canPaste != old
d->canPaste != oldDescription
TRUEevaluated 298 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 518 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| !d->canPasteValid
!d->canPasteValidDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 498 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
20-518
2019 d->canPasteValid = true;-
2020 if (changed
changedDescription
TRUEevaluated 318 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 498 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
318-498
2021 canPasteChanged();
executed 318 times by 2 tests: canPasteChanged();
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
318
2022-
2023}
executed 816 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
816
2024-
2025void QQuickTextInput::q_updateAlignment()-
2026{-
2027 QQuickTextInputPrivate * const d = d_func();-
2028 if (d->determineHorizontalAlignment()
d->determineHo...talAlignment()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 402 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
12-402
2029 d->updateLayout();-
2030 updateCursorRectangle();-
2031 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
2032}
executed 414 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
414
2033-
2034-
2035-
2036-
2037-
2038-
2039-
2040void QQuickTextInputPrivate::updateDisplayText(bool forceUpdate)-
2041{-
2042 QString orig = m_textLayout.text();-
2043 QString str;-
2044 if (m_echoMode == QQuickTextInput::NoEcho
m_echoMode == ...tInput::NoEchoDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3708 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
6-3708
2045 str = QString::fromLatin1("");
executed 6 times by 1 test: str = QString::fromLatin1("");
Executed by:
  • tst_qquicktextinput
6
2046 else-
2047 str = m_text;
executed 3708 times by 4 tests: str = m_text;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3708
2048-
2049 if (m_echoMode == QQuickTextInput::Password
m_echoMode == ...nput::PasswordDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3682 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
32-3682
2050 str.fill(m_passwordCharacter);-
2051 if (m_passwordEchoTimer.isActive()
m_passwordEchoTimer.isActive()Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_cursor > 0
m_cursor > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& m_cursor <= m_text.length()
m_cursor <= m_text.length()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-32
2052 int cursor = m_cursor - 1;-
2053 QChar uc = m_text.at(cursor);-
2054 str[cursor] = uc;-
2055 if (cursor > 0
cursor > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& uc.unicode() >= 0xdc00
uc.unicode() >= 0xdc00Description
TRUEnever evaluated
FALSEnever evaluated
&& uc.unicode() < 0xe000
uc.unicode() < 0xe000Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2056-
2057-
2058 uc = m_text.at(cursor - 1);-
2059 if (uc.unicode() >= 0xd800
uc.unicode() >= 0xd800Description
TRUEnever evaluated
FALSEnever evaluated
&& uc.unicode() < 0xdc00
uc.unicode() < 0xdc00Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2060 str[cursor - 1] = uc;
never executed: str[cursor - 1] = uc;
0
2061 }
never executed: end of block
0
2062 }
never executed: end of block
0
2063 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
m_echoMode == ...wordEchoOnEditDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3660 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& !m_passwordEchoEditing
!m_passwordEchoEditingDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
10-3660
2064 str.fill(m_passwordCharacter);-
2065 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
2066-
2067-
2068-
2069-
2070 QChar* uc = str.data();-
2071 for (int i = 0; i < str.length()
i < str.length()Description
TRUEevaluated 48304 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 3714 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
; ++i) {
3714-48304
2072 if ((uc[i].unicode() < 0x20
uc[i].unicode() < 0x20Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 48298 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& uc[i] != QChar::Tabulation
uc[i] != QChar::TabulationDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEnever evaluated
)
0-48298
2073 || uc[i] == QChar::LineSeparator
uc[i] == QChar::LineSeparatorDescription
TRUEnever evaluated
FALSEevaluated 48298 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
0-48298
2074 || uc[i] == QChar::ParagraphSeparator
uc[i] == QChar...graphSeparatorDescription
TRUEnever evaluated
FALSEevaluated 48298 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
0-48298
2075 || uc[i] == QChar::ObjectReplacementCharacter
uc[i] == QChar...ementCharacterDescription
TRUEnever evaluated
FALSEevaluated 48298 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
0-48298
2076 uc[i] = QChar(0x0020);
executed 6 times by 2 tests: uc[i] = QChar(0x0020);
Executed by:
  • tst_examples
  • tst_qquicktextinput
6
2077 }
executed 48304 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
48304
2078-
2079 if (str != orig
str != origDescription
TRUEevaluated 3184 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 530 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| forceUpdate
forceUpdateDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 438 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
92-3184
2080 m_textLayout.setText(str);-
2081 updateLayout();-
2082 q_func()->displayTextChanged();-
2083 }
executed 3276 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3276
2084}
executed 3714 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3714
2085-
2086qreal QQuickTextInputPrivate::getImplicitWidth() const-
2087{-
2088 const QQuickTextInput * const q = q_func();-
2089 if (!requireImplicitWidth
!requireImplicitWidthDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-38
2090 QQuickTextInputPrivate *d = const_cast<QQuickTextInputPrivate *>(this);-
2091 d->requireImplicitWidth = true;-
2092-
2093 if (q->isComponentComplete()
q->isComponentComplete()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-10
2094-
2095-
2096 QTextLayout layout(m_text);-
2097-
2098 QTextOption option = m_textLayout.textOption();-
2099 option.setTextDirection(m_layoutDirection);-
2100 option.setFlags(QTextOption::IncludeTrailingSpaces);-
2101 option.setWrapMode(QTextOption::WrapMode(wrapMode));-
2102 option.setAlignment(Qt::Alignment(q->effectiveHAlign()));-
2103 layout.setTextOption(option);-
2104 layout.setFont(font);-
2105-
2106 layout.setPreeditArea(m_textLayout.preeditAreaPosition(), m_textLayout.preeditAreaText());-
2107-
2108 layout.beginLayout();-
2109-
2110 QTextLine line = layout.createLine();-
2111 line.setLineWidth(0x7fffffff);-
2112 d->implicitWidth = qCeil(line.naturalTextWidth()) + q->leftPadding() + q->rightPadding();-
2113-
2114 layout.endLayout();-
2115 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
2116 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
2117 return
executed 52 times by 1 test: return implicitWidth;
Executed by:
  • tst_qquicktextinput
implicitWidth;
executed 52 times by 1 test: return implicitWidth;
Executed by:
  • tst_qquicktextinput
52
2118}-
2119-
2120void QQuickTextInputPrivate::setTopPadding(qreal value, bool reset)-
2121{-
2122 QQuickTextInput * const q = q_func();-
2123 qreal oldPadding = q->topPadding();-
2124 if (!reset
!resetDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| extra.isAllocated()
extra.isAllocated()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-14
2125 extra.value().topPadding = value;-
2126 extra.value().explicitTopPadding = !reset;-
2127 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2128 if ((!reset
!resetDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !qFuzzyCompare(oldPadding, value)
!qFuzzyCompare...adding, value)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) || (reset
resetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !qFuzzyCompare(oldPadding, padding())
!qFuzzyCompare...ng, padding())Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-14
2129 updateLayout();-
2130 q->topPaddingChanged();-
2131 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2132}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2133-
2134void QQuickTextInputPrivate::setLeftPadding(qreal value, bool reset)-
2135{-
2136 QQuickTextInput * const q = q_func();-
2137 qreal oldPadding = q->leftPadding();-
2138 if (!reset
!resetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| extra.isAllocated()
extra.isAllocated()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4
2139 extra.value().leftPadding = value;-
2140 extra.value().explicitLeftPadding = !reset;-
2141 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2142 if ((!reset
!resetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !qFuzzyCompare(oldPadding, value)
!qFuzzyCompare...adding, value)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) || (reset
resetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !qFuzzyCompare(oldPadding, padding())
!qFuzzyCompare...ng, padding())Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-4
2143 updateLayout();-
2144 q->leftPaddingChanged();-
2145 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2146}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2147-
2148void QQuickTextInputPrivate::setRightPadding(qreal value, bool reset)-
2149{-
2150 QQuickTextInput * const q = q_func();-
2151 qreal oldPadding = q->rightPadding();-
2152 if (!reset
!resetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| extra.isAllocated()
extra.isAllocated()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4
2153 extra.value().rightPadding = value;-
2154 extra.value().explicitRightPadding = !reset;-
2155 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2156 if ((!reset
!resetDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !qFuzzyCompare(oldPadding, value)
!qFuzzyCompare...adding, value)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) || (reset
resetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !qFuzzyCompare(oldPadding, padding())
!qFuzzyCompare...ng, padding())Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-4
2157 updateLayout();-
2158 q->rightPaddingChanged();-
2159 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2160}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2161-
2162void QQuickTextInputPrivate::setBottomPadding(qreal value, bool reset)-
2163{-
2164 QQuickTextInput * const q = q_func();-
2165 qreal oldPadding = q->bottomPadding();-
2166 if (!reset
!resetDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| extra.isAllocated()
extra.isAllocated()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-14
2167 extra.value().bottomPadding = value;-
2168 extra.value().explicitBottomPadding = !reset;-
2169 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2170 if ((!reset
!resetDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !qFuzzyCompare(oldPadding, value)
!qFuzzyCompare...adding, value)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) || (reset
resetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& !qFuzzyCompare(oldPadding, padding())
!qFuzzyCompare...ng, padding())Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-14
2171 updateLayout();-
2172 q->bottomPaddingChanged();-
2173 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2174}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2175-
2176bool QQuickTextInputPrivate::isImplicitResizeEnabled() const-
2177{-
2178 return
executed 11336 times by 5 tests: return !extra.isAllocated() || extra->implicitResize;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
!extra.isAllocated() || extra->implicitResize;
executed 11336 times by 5 tests: return !extra.isAllocated() || extra->implicitResize;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
11336
2179}-
2180-
2181void QQuickTextInputPrivate::setImplicitResizeEnabled(bool enabled)-
2182{-
2183 if (!enabled
!enabledDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-6
2184 extra.value().implicitResize = false;
executed 6 times by 1 test: extra.value().implicitResize = false;
Executed by:
  • tst_qquicktextinput
6
2185 else if (extra.isAllocated()
extra.isAllocated()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2186 extra->implicitResize = true;
never executed: extra->implicitResize = true;
0
2187}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2188-
2189void QQuickTextInputPrivate::updateLayout()-
2190{-
2191 QQuickTextInput * const q = q_func();-
2192-
2193 if (!q->isComponentComplete()
!q->isComponentComplete()Description
TRUEevaluated 1068 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 6090 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
1068-6090
2194 return;
executed 1068 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1068
2195-
2196-
2197 QTextOption option = m_textLayout.textOption();-
2198 option.setTextDirection(layoutDirection());-
2199 option.setWrapMode(QTextOption::WrapMode(wrapMode));-
2200 option.setAlignment(Qt::Alignment(q->effectiveHAlign()));-
2201 if (!qmlDisableDistanceField()
!qmlDisableDistanceField()Description
TRUEevaluated 6090 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
)
0-6090
2202 option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);
executed 6090 times by 5 tests: option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6090
2203-
2204 m_textLayout.setTextOption(option);-
2205 m_textLayout.setFont(font);-
2206-
2207 m_textLayout.beginLayout();-
2208-
2209 QTextLine line = m_textLayout.createLine();-
2210 if (requireImplicitWidth
requireImplicitWidthDescription
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6028 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
62-6028
2211 line.setLineWidth(0x7fffffff);-
2212 const bool wasInLayout = inLayout;-
2213 inLayout = true;-
2214 if (isImplicitResizeEnabled()
isImplicitResizeEnabled()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-62
2215 q->setImplicitWidth(qCeil(line.naturalTextWidth()) + q->leftPadding() + q->rightPadding());
executed 62 times by 1 test: q->setImplicitWidth(qCeil(line.naturalTextWidth()) + q->leftPadding() + q->rightPadding());
Executed by:
  • tst_qquicktextinput
62
2216 inLayout = wasInLayout;-
2217 if (inLayout
inLayoutDescription
TRUEnever evaluated
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-62
2218 return;
never executed: return;
0
2219 }
executed 62 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
62
2220 qreal lineWidth = q->widthValid()
q->widthValid()Description
TRUEevaluated 906 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 5184 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
|| !isImplicitResizeEnabled()
!isImplicitResizeEnabled()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 5168 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
? q->width() - q->leftPadding() - q->rightPadding() : 0x7fffffff;
16-5184
2221 qreal height = 0;-
2222 qreal width = 0;-
2223 do {-
2224 line.setLineWidth(lineWidth);-
2225 line.setPosition(QPointF(0, height));-
2226-
2227 height += line.height();-
2228 width = qMax(width, line.naturalTextWidth());-
2229-
2230 line = m_textLayout.createLine();-
2231 }
executed 6532 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
while (line.isValid()
line.isValid()Description
TRUEevaluated 442 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6090 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
);
442-6532
2232 m_textLayout.endLayout();-
2233-
2234 option.setWrapMode(QTextOption::NoWrap);-
2235 m_textLayout.setTextOption(option);-
2236-
2237 textLayoutDirty = true;-
2238-
2239 const QSizeF previousSize = contentSize;-
2240 contentSize = QSizeF(width, height);-
2241-
2242 updateType = UpdatePaintNode;-
2243 q->polish();-
2244 q->update();-
2245-
2246 if (isImplicitResizeEnabled()
isImplicitResizeEnabled()Description
TRUEevaluated 6074 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-6074
2247 if (!requireImplicitWidth
!requireImplicitWidthDescription
TRUEevaluated 6012 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !q->widthValid()
!q->widthValid()Description
TRUEevaluated 5162 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 850 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
62-6012
2248 q->setImplicitSize(width + q->leftPadding() + q->rightPadding(), height + q->topPadding() + q->bottomPadding());
executed 5162 times by 4 tests: q->setImplicitSize(width + q->leftPadding() + q->rightPadding(), height + q->topPadding() + q->bottomPadding());
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
5162
2249 else-
2250 q->setImplicitHeight(height + q->topPadding() + q->bottomPadding());
executed 912 times by 4 tests: q->setImplicitHeight(height + q->topPadding() + q->bottomPadding());
Executed by:
  • tst_examples
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
912
2251 }-
2252-
2253 updateBaselineOffset();-
2254-
2255 if (previousSize != contentSize
previousSize != contentSizeDescription
TRUEevaluated 3254 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 2836 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquicktextedit
  • tst_qquicktextinput
)
2836-3254
2256 q->contentSizeChanged();
executed 3254 times by 5 tests: q->contentSizeChanged();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
3254
2257}
executed 6090 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6090
2258-
2259-
2260-
2261-
2262-
2263-
2264-
2265void QQuickTextInputPrivate::updateBaselineOffset()-
2266{-
2267 QQuickTextInput * const q = q_func();-
2268 if (!q->isComponentComplete()
!q->isComponentComplete()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6106 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
12-6106
2269 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
12
2270 QFontMetricsF fm(font);-
2271 qreal yoff = 0;-
2272 if (q->heightValid()
q->heightValid()Description
TRUEevaluated 772 times by 3 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 5334 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
772-5334
2273 const qreal surplusHeight = q->height() - contentSize.height() - q->topPadding() - q->bottomPadding();-
2274 if (vAlign == QQuickTextInput::AlignBottom
vAlign == QQui...t::AlignBottomDescription
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 714 times by 3 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
58-714
2275 yoff = surplusHeight;
executed 58 times by 1 test: yoff = surplusHeight;
Executed by:
  • tst_qquicktextinput
58
2276 else if (vAlign == QQuickTextInput::AlignVCenter
vAlign == QQui...::AlignVCenterDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 672 times by 3 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
)
42-672
2277 yoff = surplusHeight/2;
executed 42 times by 1 test: yoff = surplusHeight/2;
Executed by:
  • tst_qquicktextinput
42
2278 }
executed 772 times by 3 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
772
2279 q->setBaselineOffset(fm.ascent() + yoff + q->topPadding());-
2280}
executed 6106 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
6106
2281void QQuickTextInputPrivate::copy(QClipboard::Mode mode) const-
2282{-
2283 QString t = selectedText();-
2284 if (!t.isEmpty()
!t.isEmpty()Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_echoMode == QQuickTextInput::Normal
m_echoMode == ...tInput::NormalDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
12-76
2285 QGuiApplication::clipboard()->setText(t, mode);-
2286 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
64
2287}
executed 118 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
118
2288void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode)-
2289{-
2290 QString clip = QGuiApplication::clipboard()->text(clipboardMode);-
2291 if (!clip.isEmpty()
!clip.isEmpty()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
|| hasSelectedText()
hasSelectedText()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-14
2292 separate();-
2293 insert(clip);-
2294 separate();-
2295 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
2296}
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
2297-
2298-
2299-
2300-
2301-
2302-
2303-
2304void QQuickTextInputPrivate::commitPreedit()-
2305{-
2306 QQuickTextInput * const q = q_func();-
2307-
2308 if (!hasImState
!hasImStateDescription
TRUEevaluated 2278 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
)
0-2278
2309 return;
executed 2278 times by 2 tests: return;
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
2278
2310-
2311 QGuiApplication::inputMethod()->commit();-
2312-
2313 if (!hasImState
!hasImStateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2314 return;
never executed: return;
0
2315-
2316 QInputMethodEvent ev;-
2317 QCoreApplication::sendEvent(q, &ev);-
2318}
never executed: end of block
0
2319-
2320void QQuickTextInputPrivate::cancelPreedit()-
2321{-
2322 QQuickTextInput * const q = q_func();-
2323-
2324 if (!hasImState
!hasImStateDescription
TRUEevaluated 1242 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-1242
2325 return;
executed 1242 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1242
2326-
2327 QGuiApplication::inputMethod()->reset();-
2328-
2329 QInputMethodEvent ev;-
2330 QCoreApplication::sendEvent(q, &ev);-
2331}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
2332void QQuickTextInputPrivate::backspace()-
2333{-
2334 int priorState = m_undoState;-
2335 if (separateSelection()
separateSelection()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-56
2336 removeSelectedText();-
2337 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (m_cursor
m_cursorDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-54
2338 --m_cursor;-
2339 if (m_maskData
m_maskDataDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
16-38
2340 m_cursor = prevMaskBlank(m_cursor);
executed 16 times by 1 test: m_cursor = prevMaskBlank(m_cursor);
Executed by:
  • tst_qquicktextinput
16
2341 QChar uc = m_text.at(m_cursor);-
2342 if (m_cursor > 0
m_cursor > 0Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& uc.unicode() >= 0xdc00
uc.unicode() >= 0xdc00Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& uc.unicode() < 0xe000
uc.unicode() < 0xe000Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-52
2343-
2344-
2345 uc = m_text.at(m_cursor - 1);-
2346 if (uc.unicode() >= 0xd800
uc.unicode() >= 0xd800Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& uc.unicode() < 0xdc00
uc.unicode() < 0xdc00Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-10
2347 internalDelete(true);-
2348 --m_cursor;-
2349 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
2350 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
2351 internalDelete(true);-
2352 }
executed 54 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
54
2353 finishChange(priorState);-
2354}
executed 60 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
60
2355void QQuickTextInputPrivate::del()-
2356{-
2357 int priorState = m_undoState;-
2358 if (separateSelection()
separateSelection()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-28
2359 removeSelectedText();-
2360 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
14
2361 int n = m_textLayout.nextCursorPosition(m_cursor) - m_cursor;-
2362 while (n--
n--Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
28-36
2363 internalDelete();
executed 36 times by 1 test: internalDelete();
Executed by:
  • tst_qquicktextinput
36
2364 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
28
2365 finishChange(priorState);-
2366}
executed 42 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
42
2367void QQuickTextInputPrivate::insert(const QString &newText)-
2368{-
2369 int priorState = m_undoState;-
2370 if (separateSelection()
separateSelection()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1360 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
16-1360
2371 removeSelectedText();
executed 16 times by 1 test: removeSelectedText();
Executed by:
  • tst_qquicktextinput
16
2372 internalInsert(newText);-
2373 finishChange(priorState);-
2374}
executed 1376 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1376
2375-
2376-
2377-
2378-
2379-
2380-
2381void QQuickTextInputPrivate::clear()-
2382{-
2383 int priorState = m_undoState;-
2384 separateSelection();-
2385 m_selstart = 0;-
2386 m_selend = m_text.length();-
2387 removeSelectedText();-
2388 separate();-
2389 finishChange(priorState, false, false);-
2390}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
2391void QQuickTextInputPrivate::setSelection(int start, int length)-
2392{-
2393 QQuickTextInput * const q = q_func();-
2394-
2395 commitPreedit();-
2396-
2397-
2398 if (start < 0
start < 0Description
TRUEnever evaluated
FALSEevaluated 680 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| start > m_text.length()
start > m_text.length()Description
TRUEnever evaluated
FALSEevaluated 680 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-680
2399 QMessageLogger(__FILE__, 3279, __PRETTY_FUNCTION__).warning("QQuickTextInputPrivate::setSelection: Invalid start position");-
2400 return;
never executed: return;
0
2401 }-
2402-
2403 if (length > 0
length > 0Description
TRUEevaluated 392 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 288 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
288-392
2404 if (start == m_selstart
start == m_selstartDescription
TRUEevaluated 192 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 200 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& start + length == m_selend
start + length == m_selendDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_cursor == m_selend
m_cursor == m_selendDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-200
2405 return;
executed 20 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
20
2406 m_selstart = start;-
2407 m_selend = qMin(start + length, m_text.length());-
2408 m_cursor = m_selend;-
2409 }
executed 372 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (length < 0
length < 0Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
){
144-372
2410 if (start == m_selend
start == m_selendDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& start + length == m_selstart
start + length == m_selstartDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_cursor == m_selstart
m_cursor == m_selstartDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-124
2411 return;
never executed: return;
0
2412 m_selstart = qMax(start + length, 0);-
2413 m_selend = start;-
2414 m_cursor = m_selstart;-
2415 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (m_selstart != m_selend
m_selstart != m_selendDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-144
2416 m_selstart = 0;-
2417 m_selend = 0;-
2418 m_cursor = start;-
2419 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
6
2420 m_cursor = start;-
2421 emitCursorPositionChanged();-
2422 return;
executed 138 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
138
2423 }-
2424 q->selectionChanged();-
2425 emitCursorPositionChanged();-
2426-
2427 q->updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | Qt::ImCursorPosition | Qt::ImAnchorPosition-
2428 | Qt::ImCurrentSelection);-
2429-
2430}
executed 522 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
522
2431void QQuickTextInputPrivate::updatePasswordEchoEditing(bool editing)-
2432{-
2433 cancelPasswordEchoTimer();-
2434 m_passwordEchoEditing = editing;-
2435 updateDisplayText();-
2436}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
2437bool QQuickTextInputPrivate::fixup()-
2438{-
2439-
2440 if (m_validator
m_validatorDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-8
2441 QString textCopy = m_text;-
2442 int cursorCopy = m_cursor;-
2443 m_validator->fixup(textCopy);-
2444 if (m_validator->validate(textCopy, cursorCopy) == QValidator::Acceptable
m_validator->v...or::AcceptableDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4
2445 if (textCopy != m_text
textCopy != m_textDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
|| cursorCopy != m_cursor
cursorCopy != m_cursorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-4
2446 internalSetText(textCopy, cursorCopy);
executed 4 times by 1 test: internalSetText(textCopy, cursorCopy);
Executed by:
  • tst_qquicktextinput
4
2447 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
4
2448 }-
2449 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
2450-
2451 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
4
2452}-
2453-
2454-
2455-
2456-
2457-
2458-
2459-
2460void QQuickTextInputPrivate::moveCursor(int pos, bool mark)-
2461{-
2462 QQuickTextInput * const q = q_func();-
2463-
2464 commitPreedit();-
2465-
2466-
2467 if (pos != m_cursor
pos != m_cursorDescription
TRUEevaluated 1370 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 222 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
222-1370
2468 separate();-
2469 if (m_maskData
m_maskDataDescription
TRUEevaluated 264 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1106 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
264-1106
2470 pos = pos > m_cursor
pos > m_cursorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 260 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? nextMaskBlank(pos) : prevMaskBlank(pos);
executed 264 times by 1 test: pos = pos > m_cursor ? nextMaskBlank(pos) : prevMaskBlank(pos);
Executed by:
  • tst_qquicktextinput
4-264
2471 }
executed 1370 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1370
2472 if (mark
markDescription
TRUEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1432 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
160-1432
2473 int anchor;-
2474 if (m_selend > m_selstart
m_selend > m_selstartDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_cursor == m_selstart
m_cursor == m_selstartDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
10-138
2475 anchor = m_selend;
executed 10 times by 1 test: anchor = m_selend;
Executed by:
  • tst_qquicktextinput
10
2476 else if (m_selend > m_selstart
m_selend > m_selstartDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 138 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_cursor == m_selend
m_cursor == m_selendDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-138
2477 anchor = m_selstart;
executed 12 times by 1 test: anchor = m_selstart;
Executed by:
  • tst_qquicktextinput
12
2478 else-
2479 anchor = m_cursor;
executed 138 times by 1 test: anchor = m_cursor;
Executed by:
  • tst_qquicktextinput
138
2480 m_selstart = qMin(anchor, pos);-
2481 m_selend = qMax(anchor, pos);-
2482 }
executed 160 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
160
2483 internalDeselect();-
2484 }
executed 1432 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1432
2485 m_cursor = pos;-
2486 if (mark
markDescription
TRUEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1432 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| m_selDirty
m_selDirtyDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1348 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
84-1432
2487 m_selDirty = false;-
2488 q->selectionChanged();-
2489 }
executed 244 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
244
2490 emitCursorPositionChanged();-
2491-
2492 q->updateInputMethod();-
2493-
2494}
executed 1592 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1592
2495void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)-
2496{-
2497 QQuickTextInput * const q = q_func();-
2498-
2499 int priorState = -1;-
2500 bool isGettingInput = !event->commitString().isEmpty()
!event->commit...ng().isEmpty()Description
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 200 times by 1 test
Evaluated by:
  • tst_qquicktextinput
148-200
2501 || event->preeditString() != preeditAreaText()
event->preedit...editAreaText()Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquicktextinput
46-154
2502 || event->replacementLength() > 0
event->replacementLength() > 0Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
46-108
2503 bool cursorPositionChanged = false;-
2504 bool selectionChange = false;-
2505 m_preeditDirty = event->preeditString() != preeditAreaText();-
2506-
2507 if (isGettingInput
isGettingInputDescription
TRUEevaluated 302 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
46-302
2508-
2509 priorState = m_undoState;-
2510 separateSelection();-
2511 if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
m_echoMode == ...wordEchoOnEditDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 300 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_passwordEchoEditing
!m_passwordEchoEditingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-300
2512 updatePasswordEchoEditing(true);-
2513 m_selstart = 0;-
2514 m_selend = m_text.length();-
2515 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
2516 removeSelectedText();-
2517 }
executed 302 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
302
2518-
2519 int c = m_cursor;-
2520 if (event->replacementStart() <= 0
event->replacementStart() <= 0Description
TRUEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-348
2521 c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
executed 348 times by 1 test: c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
Executed by:
  • tst_qquicktextinput
348
2522-
2523 m_cursor += event->replacementStart();-
2524 if (m_cursor < 0
m_cursor < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 346 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
2-346
2525 m_cursor = 0;
executed 2 times by 1 test: m_cursor = 0;
Executed by:
  • tst_qquicktextinput
2
2526-
2527-
2528 if (event->replacementLength()
event->replacementLength()Description
TRUEevaluated 124 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 224 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
124-224
2529 m_selstart = m_cursor;-
2530 m_selend = m_selstart + event->replacementLength();-
2531 m_selend = qMin(m_selend, m_text.length());-
2532 removeSelectedText();-
2533 }
executed 124 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
124
2534 if (!event->commitString().isEmpty()
!event->commit...ng().isEmpty()Description
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 200 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
148-200
2535 internalInsert(event->commitString());-
2536 cursorPositionChanged = true;-
2537 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
148
2538 m_cursor = qBound(0, c, m_text.length());-
2539 }
executed 200 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
200
2540-
2541 for (int i = 0; i < event->attributes().size()
i < event->attributes().size()Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
54-348
2542 const QInputMethodEvent::Attribute &a = event->attributes().at(i);-
2543 if (a.type == QInputMethodEvent::Selection
a.type == QInp...ent::SelectionDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-48
2544 m_cursor = qBound(0, a.start + a.length, m_text.length());-
2545 if (a.length
a.lengthDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-6
2546 m_selstart = qMax(0, qMin(a.start, m_text.length()));-
2547 m_selend = m_cursor;-
2548 if (m_selend < m_selstart
m_selend < m_selstartDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-6
2549 qSwap(m_selstart, m_selend);-
2550 }
never executed: end of block
0
2551 selectionChange = true;-
2552 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
6
2553 m_selstart = m_selend = 0;-
2554 }
never executed: end of block
0
2555 cursorPositionChanged = true;-
2556 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2557 }
executed 54 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
54
2558 QString oldPreeditString = m_textLayout.preeditAreaText();-
2559 m_textLayout.setPreeditArea(m_cursor, event->preeditString());-
2560 if (oldPreeditString != m_textLayout.preeditAreaText()
oldPreeditStri...editAreaText()Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 302 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
46-302
2561 q->preeditTextChanged();
executed 46 times by 1 test: q->preeditTextChanged();
Executed by:
  • tst_qquicktextinput
46
2562 const int oldPreeditCursor = m_preeditCursor;-
2563 m_preeditCursor = event->preeditString().length();-
2564 hasImState = !event->preeditString().isEmpty();-
2565 bool cursorVisible = true;-
2566 QVector<QTextLayout::FormatRange> formats;-
2567 for (int i = 0; i < event->attributes().size()
i < event->attributes().size()Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 348 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
54-348
2568 const QInputMethodEvent::Attribute &a = event->attributes().at(i);-
2569 if (a.type == QInputMethodEvent::Cursor
a.type == QInp...dEvent::CursorDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
8-46
2570 hasImState = true;-
2571 m_preeditCursor = a.start;-
2572 cursorVisible = a.length != 0;-
2573 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (a.type == QInputMethodEvent::TextFormat
a.type == QInp...nt::TextFormatDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-46
2574 hasImState = true;-
2575 QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat();-
2576 if (f.isValid()
f.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-2
2577 QTextLayout::FormatRange o;-
2578 o.start = a.start + m_cursor;-
2579 o.length = a.length;-
2580 o.format = f;-
2581 formats.append(o);-
2582 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
2583 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
2584 }
executed 54 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
54
2585 m_textLayout.setFormats(formats);-
2586-
2587 updateDisplayText( true);-
2588 if ((cursorPositionChanged
cursorPositionChangedDescription
TRUEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 194 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !emitCursorPositionChanged()
!emitCursorPositionChanged()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
8-194
2589 || m_preeditCursor != oldPreeditCursor
m_preeditCurso...dPreeditCursorDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 266 times by 1 test
Evaluated by:
  • tst_qquicktextinput
74-266
2590 || isGettingInput
isGettingInputDescription
TRUEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
12-254
2591 q->updateCursorRectangle();-
2592 }
executed 336 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
336
2593-
2594 if (isGettingInput
isGettingInputDescription
TRUEevaluated 302 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
46-302
2595 finishChange(priorState);
executed 302 times by 1 test: finishChange(priorState);
Executed by:
  • tst_qquicktextinput
302
2596-
2597 q->setCursorVisible(cursorVisible);-
2598-
2599 if (selectionChange
selectionChangeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 342 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-342
2600 q->selectionChanged();-
2601 q->updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle-
2602 | Qt::ImCurrentSelection);-
2603 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
2604}
executed 348 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
348
2605void QQuickTextInputPrivate::selectWordAtPos(int cursor)-
2606{-
2607 int next = cursor + 1;-
2608 if (next > end()
next > end()Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-10
2609 --
never executed: --next;
next;
never executed: --next;
0
2610 int c = m_textLayout.previousCursorPosition(next, QTextLayout::SkipWords);-
2611 moveCursor(c, false);-
2612-
2613 int end = m_textLayout.nextCursorPosition(c, QTextLayout::SkipWords);-
2614 while (end > cursor
end > cursorDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& m_text[end-1].isSpace()
m_text[end-1].isSpace()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-20
2615 --
executed 10 times by 1 test: --end;
Executed by:
  • tst_qquicktextinput
end;
executed 10 times by 1 test: --end;
Executed by:
  • tst_qquicktextinput
10
2616 moveCursor(end, true);-
2617}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
2618bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bool edited)-
2619{-
2620 QQuickTextInput * const q = q_func();-
2621-
2622 (void)update;-
2623-
2624 bool inputMethodAttributesChanged = m_textDirty
m_textDirtyDescription
TRUEevaluated 3266 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 416 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| m_selDirty
m_selDirtyDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 406 times by 1 test
Evaluated by:
  • tst_qquicktextinput
;
10-3266
2625-
2626 bool alignmentChanged = false;-
2627 bool textChanged = false;-
2628-
2629 if (m_textDirty
m_textDirtyDescription
TRUEevaluated 3266 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 416 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
416-3266
2630-
2631 bool wasValidInput = m_validInput;-
2632 bool wasAcceptable = m_acceptableInput;-
2633 m_validInput = true;-
2634 m_acceptableInput = true;-
2635-
2636 if (m_validator
m_validatorDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3118 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
148-3118
2637 QString textCopy = m_text;-
2638 if (m_maskData
m_maskDataDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
56-92
2639 textCopy = maskString(0, m_text, true);
executed 56 times by 1 test: textCopy = maskString(0, m_text, true);
Executed by:
  • tst_qquicktextinput
56
2640 int cursorCopy = m_cursor;-
2641 QValidator::State state = m_validator->validate(textCopy, cursorCopy);-
2642 if (m_maskData
m_maskDataDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
56-92
2643 textCopy = m_text;
executed 56 times by 1 test: textCopy = m_text;
Executed by:
  • tst_qquicktextinput
56
2644 m_validInput = state != QValidator::Invalid;-
2645 m_acceptableInput = state == QValidator::Acceptable;-
2646 if (m_validInput
m_validInputDescription
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_maskData
!m_maskDataDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
28-120
2647 if (m_text != textCopy
m_text != textCopyDescription
TRUEnever evaluated
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-72
2648 internalSetText(textCopy, cursorCopy);-
2649 return
never executed: return true;
true;
never executed: return true;
0
2650 }-
2651 m_cursor = cursorCopy;-
2652 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
72
2653 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
148
2654-
2655 if (m_maskData
m_maskDataDescription
TRUEevaluated 1054 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2212 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
1054-2212
2656 checkIsValid();
executed 1054 times by 1 test: checkIsValid();
Executed by:
  • tst_qquicktextinput
1054
2657-
2658 if (validateFromState >= 0
validateFromState >= 0Description
TRUEevaluated 1906 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1360 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& wasValidInput
wasValidInputDescription
TRUEevaluated 1892 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_validInput
!m_validInputDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1876 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-1906
2659 if (m_transactions.count()
m_transactions.count()Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-16
2660 return
never executed: return false;
false;
never executed: return false;
0
2661 internalUndo(validateFromState);-
2662 m_history.resize(m_undoState);-
2663 m_validInput = true;-
2664 m_acceptableInput = wasAcceptable;-
2665 m_textDirty = false;-
2666 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
2667-
2668 if (m_textDirty
m_textDirtyDescription
TRUEevaluated 3250 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
16-3250
2669 textChanged = true;-
2670 m_textDirty = false;-
2671-
2672 m_preeditDirty = false;-
2673-
2674 alignmentChanged = determineHorizontalAlignment();-
2675 if (edited
editedDescription
TRUEevaluated 2294 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 956 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
956-2294
2676 q->textEdited();
executed 2294 times by 1 test: q->textEdited();
Executed by:
  • tst_qquicktextinput
2294
2677 q->textChanged();-
2678 }
executed 3250 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3250
2679-
2680 updateDisplayText(alignmentChanged);-
2681-
2682 if (m_acceptableInput != wasAcceptable
m_acceptableIn... wasAcceptableDescription
TRUEevaluated 230 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3036 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
230-3036
2683 q->acceptableInputChanged();
executed 230 times by 1 test: q->acceptableInputChanged();
Executed by:
  • tst_qquicktextinput
230
2684 }
executed 3266 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3266
2685-
2686 if (m_preeditDirty
m_preeditDirtyDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3636 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
46-3636
2687 m_preeditDirty = false;-
2688 if (determineHorizontalAlignment()
determineHorizontalAlignment()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-42
2689 alignmentChanged = true;-
2690 updateLayout();-
2691 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
2692 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
46
2693-
2694-
2695 if (m_selDirty
m_selDirtyDescription
TRUEevaluated 230 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3452 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
230-3452
2696 m_selDirty = false;-
2697 q->selectionChanged();-
2698 }
executed 230 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
230
2699-
2700-
2701 inputMethodAttributesChanged |= (m_cursor != m_lastCursorPos);-
2702 if (inputMethodAttributesChanged
inputMethodAttributesChangedDescription
TRUEevaluated 3288 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 394 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
394-3288
2703 q->updateInputMethod();
executed 3288 times by 4 tests: q->updateInputMethod();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3288
2704-
2705 emitUndoRedoChanged();-
2706-
2707 if (!emitCursorPositionChanged()
!emitCursorPositionChanged()Description
TRUEevaluated 948 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2734 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& (alignmentChanged
alignmentChangedDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 944 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| textChanged
textChangedDescription
TRUEevaluated 530 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 414 times by 1 test
Evaluated by:
  • tst_qquicktextinput
))
4-2734
2708 q->updateCursorRectangle();
executed 534 times by 1 test: q->updateCursorRectangle();
Executed by:
  • tst_qquicktextinput
534
2709-
2710 return
executed 3682 times by 4 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
true;
executed 3682 times by 4 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3682
2711}-
2712-
2713-
2714-
2715-
2716-
2717-
2718void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool edited)-
2719{-
2720 internalDeselect();-
2721 QString oldText = m_text;-
2722 if (m_maskData
m_maskDataDescription
TRUEevaluated 726 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 780 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
726-780
2723 m_text = maskString(0, txt, true);-
2724 m_text += clearString(m_text.length(), m_maxLength - m_text.length());-
2725 }
executed 726 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
726
2726 m_text = txt.isEmpty()
txt.isEmpty()Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 722 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
? txt : txt.left(m_maxLength);
58-722
2727 }
executed 780 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
780
2728 m_history.clear();-
2729 m_undoState = 0;-
2730 m_cursor = (pos < 0
pos < 0Description
TRUEevaluated 1502 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| pos > m_text.length()
pos > m_text.length()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) ? m_text.length() : pos;
0-1502
2731 m_textDirty = (oldText != m_text);-
2732-
2733 bool changed = finishChange(-1, true, edited);-
2734-
2735-
2736-
2737 QQuickTextInput * const q = q_func();-
2738 if (changed
changedDescription
TRUEevaluated 1506 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
&& QAccessible::isActive()
QAccessible::isActive()Description
TRUEnever evaluated
FALSEevaluated 1506 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-1506
2739 if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)
QObject *acc =...:EditableText)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2740 QAccessibleTextUpdateEvent ev(acc, 0, oldText, m_text);-
2741 QAccessible::updateAccessibility(&ev);-
2742 }
never executed: end of block
0
2743 }
never executed: end of block
0
2744-
2745}
executed 1506 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1506
2746void QQuickTextInputPrivate::addCommand(const Command &cmd)-
2747{-
2748 if (m_separator
m_separatorDescription
TRUEevaluated 396 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4638 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_undoState
m_undoStateDescription
TRUEevaluated 162 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 234 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_history[m_undoState - 1].type != Separator
m_history[m_un...e != SeparatorDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
14-4638
2749 m_history.resize(m_undoState + 2);-
2750 m_history[m_undoState++] = Command(Separator, m_cursor, 0, m_selstart, m_selend);-
2751 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
148
2752 m_history.resize(m_undoState + 1);-
2753 }
executed 4886 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4886
2754 m_separator = false;-
2755 m_history[m_undoState++] = cmd;-
2756}
executed 5034 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
5034
2757void QQuickTextInputPrivate::internalInsert(const QString &s)-
2758{-
2759 QQuickTextInput * const q = q_func();-
2760 if (m_echoMode == QQuickTextInput::Password
m_echoMode == ...nput::PasswordDescription
TRUEnever evaluated
FALSEevaluated 1524 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-1524
2761 if (m_passwordMaskDelay > 0
m_passwordMaskDelay > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2762 m_passwordEchoTimer.start(m_passwordMaskDelay, q);
never executed: m_passwordEchoTimer.start(m_passwordMaskDelay, q);
0
2763 }
never executed: end of block
0
2764 ((!hasSelectedText()) ? static_cast<void>(0) : qt_assert("!hasSelectedText()", __FILE__, 3710));-
2765 if (m_maskData
m_maskDataDescription
TRUEevaluated 506 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
506-1018
2766 QString ms = maskString(m_cursor, s);-
2767 for (int i = 0; i < ms.length()
i < ms.length()Description
TRUEevaluated 518 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 506 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
506-518
2768 addCommand (Command(DeleteSelection, m_cursor + i, m_text.at(m_cursor + i), -1, -1));-
2769 addCommand(Command(Insert, m_cursor + i, ms.at(i), -1, -1));-
2770 }
executed 518 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
518
2771 m_text.replace(m_cursor, ms.length(), ms);-
2772 m_cursor += ms.length();-
2773 m_cursor = nextMaskBlank(m_cursor);-
2774 m_textDirty = true;-
2775 }
executed 506 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
506
2776 int remaining = m_maxLength - m_text.length();-
2777 if (remaining != 0
remaining != 0Description
TRUEevaluated 998 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-998
2778 const QStringRef remainingStr = s.leftRef(remaining);-
2779 m_text.insert(m_cursor, remainingStr);-
2780 for (auto e : remainingStr)-
2781 addCommand(Command(Insert, m_cursor++, e, -1, -1));
executed 1220 times by 1 test: addCommand(Command(Insert, m_cursor++, e, -1, -1));
Executed by:
  • tst_qquicktextinput
1220
2782 m_textDirty = true;-
2783 }
executed 998 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
998
2784 }
executed 1018 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1018
2785}-
2786void QQuickTextInputPrivate::internalDelete(bool wasBackspace)-
2787{-
2788 if (m_cursor < m_text.length()
m_cursor < m_text.length()Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-100
2789 cancelPasswordEchoTimer();-
2790 ((!hasSelectedText()) ? static_cast<void>(0) : qt_assert("!hasSelectedText()", __FILE__, 3748));-
2791 addCommand(Command((CommandType)((m_maskData ? 2 : 0) + (wasBackspace ? Remove : Delete)),-
2792 m_cursor, m_text.at(m_cursor), -1, -1));-
2793 if (m_maskData
m_maskDataDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-80
2794 m_text.replace(m_cursor, 1, clearString(m_cursor, 1));-
2795 addCommand(Command(Insert, m_cursor, m_text.at(m_cursor), -1, -1));-
2796 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
20
2797 m_text.remove(m_cursor, 1);-
2798 }
executed 80 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
80
2799 m_textDirty = true;-
2800 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
100
2801}
executed 100 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
100
2802void QQuickTextInputPrivate::removeSelectedText()-
2803{-
2804 if (m_selstart < m_selend
m_selstart < m_selendDescription
TRUEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 300 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_selend <= m_text.length()
m_selend <= m_text.length()Description
TRUEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-300
2805 cancelPasswordEchoTimer();-
2806 int i ;-
2807 if (m_selstart <= m_cursor
m_selstart <= m_cursorDescription
TRUEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& m_cursor < m_selend
m_cursor < m_selendDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-184
2808-
2809-
2810 for (i = m_cursor; i >= m_selstart
i >= m_selstartDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i)
144-152
2811 addCommand (Command(DeleteSelection, i, m_text.at(i), -1, 1));
executed 152 times by 1 test: addCommand (Command(DeleteSelection, i, m_text.at(i), -1, 1));
Executed by:
  • tst_qquicktextinput
152
2812 for (i = m_selend - 1; i > m_cursor
i > m_cursorDescription
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i)
86-144
2813 addCommand (Command(DeleteSelection, i - m_cursor + m_selstart - 1, m_text.at(i), -1, -1));
executed 86 times by 1 test: addCommand (Command(DeleteSelection, i - m_cursor + m_selstart - 1, m_text.at(i), -1, -1));
Executed by:
  • tst_qquicktextinput
86
2814 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
144
2815 for (i = m_selend-1; i >= m_selstart
i >= m_selstartDescription
TRUEevaluated 378 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; --i)
40-378
2816 addCommand (Command(RemoveSelection, i, m_text.at(i), -1, -1));
executed 378 times by 1 test: addCommand (Command(RemoveSelection, i, m_text.at(i), -1, -1));
Executed by:
  • tst_qquicktextinput
378
2817 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
40
2818 if (m_maskData
m_maskDataDescription
TRUEnever evaluated
FALSEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-184
2819 m_text.replace(m_selstart, m_selend - m_selstart, clearString(m_selstart, m_selend - m_selstart));-
2820 for (int i = 0; i < m_selend - m_selstart
i < m_selend - m_selstartDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2821 addCommand(Command(Insert, m_selstart + i, m_text.at(m_selstart + i), -1, -1));
never executed: addCommand(Command(Insert, m_selstart + i, m_text.at(m_selstart + i), -1, -1));
0
2822 }
never executed: end of block
else {
0
2823 m_text.remove(m_selstart, m_selend - m_selstart);-
2824 }
executed 184 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
184
2825 if (m_cursor > m_selstart
m_cursor > m_selstartDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
42-142
2826 m_cursor -= qMin(m_cursor, m_selend) - m_selstart;
executed 42 times by 1 test: m_cursor -= qMin(m_cursor, m_selend) - m_selstart;
Executed by:
  • tst_qquicktextinput
42
2827 internalDeselect();-
2828 m_textDirty = true;-
2829 }
executed 184 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
184
2830}
executed 484 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
484
2831bool QQuickTextInputPrivate::separateSelection()-
2832{-
2833 if (hasSelectedText()
hasSelectedText()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1750 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
38-1750
2834 separate();-
2835 addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));-
2836 return
executed 38 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 38 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
38
2837 } else {-
2838 return
executed 1750 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 1750 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
1750
2839 }-
2840}-
2841-
2842-
2843-
2844-
2845-
2846-
2847-
2848void QQuickTextInputPrivate::parseInputMask(const QString &maskFields)-
2849{-
2850 int delimiter = maskFields.indexOf(QLatin1Char(';'));-
2851 if (maskFields.isEmpty()
maskFields.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| delimiter == 0
delimiter == 0Description
TRUEnever evaluated
FALSEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
0-254
2852 if (m_maskData
m_maskDataDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-2
2853 delete [] m_maskData;-
2854 m_maskData = nullptr;-
2855 m_maxLength = 32767;-
2856 internalSetText(QString());-
2857 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
2858 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
2
2859 }-
2860-
2861 if (delimiter == -1
delimiter == -1Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
58-196
2862 m_blank = QLatin1Char(' ');-
2863 m_inputMask = maskFields;-
2864 }
executed 196 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
196
2865 m_inputMask = maskFields.left(delimiter);-
2866 m_blank = (
(delimiter + 1...elds.length())Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
delimiter + 1 < maskFields.length())
(delimiter + 1...elds.length())Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? maskFields[delimiter + 1] : QLatin1Char(' ');
4-54
2867 }
executed 58 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
58
2868-
2869-
2870 m_maxLength = 0;-
2871 QChar c = 0;-
2872 for (int i=0; i<m_inputMask.length()
i<m_inputMask.length()Description
TRUEevaluated 2682 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; i++) {
254-2682
2873 c = m_inputMask.at(i);-
2874 if (i > 0
i > 0Description
TRUEevaluated 2428 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_inputMask.at(i-1) == QLatin1Char('\\')
m_inputMask.at...tin1Char('\\')Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2404 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
24-2428
2875 m_maxLength++;-
2876 continue;
executed 24 times by 1 test: continue;
Executed by:
  • tst_qquicktextinput
24
2877 }-
2878 if (c != QLatin1Char('\\')
c != QLatin1Char('\\')Description
TRUEevaluated 2638 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char('!')
c != QLatin1Char('!')Description
TRUEevaluated 2558 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&&
20-2638
2879 c != QLatin1Char('<')
c != QLatin1Char('<')Description
TRUEevaluated 2468 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char('>')
c != QLatin1Char('>')Description
TRUEevaluated 2376 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&&
90-2468
2880 c != QLatin1Char('{')
c != QLatin1Char('{')Description
TRUEevaluated 2372 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char('}')
c != QLatin1Char('}')Description
TRUEevaluated 2368 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&&
4-2372
2881 c != QLatin1Char('[')
c != QLatin1Char('[')Description
TRUEevaluated 2364 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char(']')
c != QLatin1Char(']')Description
TRUEevaluated 2360 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-2364
2882 m_maxLength++;
executed 2360 times by 1 test: m_maxLength++;
Executed by:
  • tst_qquicktextinput
2360
2883 }
executed 2658 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2658
2884-
2885 delete [] m_maskData;-
2886 m_maskData = new MaskInputData[m_maxLength];-
2887-
2888 MaskInputData::Casemode m = MaskInputData::NoCaseMode;-
2889 c = 0;-
2890 bool s;-
2891 bool escape = false;-
2892 int index = 0;-
2893 for (int i = 0; i < m_inputMask.length()
i < m_inputMask.length()Description
TRUEevaluated 2682 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 254 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; i++) {
254-2682
2894 c = m_inputMask.at(i);-
2895 if (escape
escapeDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2662 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-2662
2896 s = true;-
2897 m_maskData[index].maskChar = c;-
2898 m_maskData[index].separator = s;-
2899 m_maskData[index].caseMode = m;-
2900 index++;-
2901 escape = false;-
2902 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (c == QLatin1Char('<')
c == QLatin1Char('<')Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2572 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-2572
2903 m = MaskInputData::Lower;-
2904 }
executed 90 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (c == QLatin1Char('>')
c == QLatin1Char('>')Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2480 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
90-2480
2905 m = MaskInputData::Upper;-
2906 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (c == QLatin1Char('!')
c == QLatin1Char('!')Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2400 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
80-2400
2907 m = MaskInputData::NoCaseMode;-
2908 }
executed 80 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (c != QLatin1Char('{')
c != QLatin1Char('{')Description
TRUEevaluated 2396 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char('}')
c != QLatin1Char('}')Description
TRUEevaluated 2392 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char('[')
c != QLatin1Char('[')Description
TRUEevaluated 2388 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& c != QLatin1Char(']')
c != QLatin1Char(']')Description
TRUEevaluated 2384 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-2396
2909 switch (c.unicode()) {-
2910 case
executed 280 times by 1 test: case 'A':
Executed by:
  • tst_qquicktextinput
'A':
executed 280 times by 1 test: case 'A':
Executed by:
  • tst_qquicktextinput
280
2911 case
executed 126 times by 1 test: case 'a':
Executed by:
  • tst_qquicktextinput
'a':
executed 126 times by 1 test: case 'a':
Executed by:
  • tst_qquicktextinput
126
2912 case
executed 10 times by 1 test: case 'N':
Executed by:
  • tst_qquicktextinput
'N':
executed 10 times by 1 test: case 'N':
Executed by:
  • tst_qquicktextinput
10
2913 case
executed 12 times by 1 test: case 'n':
Executed by:
  • tst_qquicktextinput
'n':
executed 12 times by 1 test: case 'n':
Executed by:
  • tst_qquicktextinput
12
2914 case
executed 14 times by 1 test: case 'X':
Executed by:
  • tst_qquicktextinput
'X':
executed 14 times by 1 test: case 'X':
Executed by:
  • tst_qquicktextinput
14
2915 case
executed 8 times by 1 test: case 'x':
Executed by:
  • tst_qquicktextinput
'x':
executed 8 times by 1 test: case 'x':
Executed by:
  • tst_qquicktextinput
8
2916 case
executed 304 times by 1 test: case '9':
Executed by:
  • tst_qquicktextinput
'9':
executed 304 times by 1 test: case '9':
Executed by:
  • tst_qquicktextinput
304
2917 case
executed 936 times by 1 test: case '0':
Executed by:
  • tst_qquicktextinput
'0':
executed 936 times by 1 test: case '0':
Executed by:
  • tst_qquicktextinput
936
2918 case
executed 12 times by 1 test: case 'D':
Executed by:
  • tst_qquicktextinput
'D':
executed 12 times by 1 test: case 'D':
Executed by:
  • tst_qquicktextinput
12
2919 case
executed 10 times by 1 test: case 'd':
Executed by:
  • tst_qquicktextinput
'd':
executed 10 times by 1 test: case 'd':
Executed by:
  • tst_qquicktextinput
10
2920 case
executed 8 times by 1 test: case '#':
Executed by:
  • tst_qquicktextinput
'#':
executed 8 times by 1 test: case '#':
Executed by:
  • tst_qquicktextinput
8
2921 case
executed 144 times by 1 test: case 'H':
Executed by:
  • tst_qquicktextinput
'H':
executed 144 times by 1 test: case 'H':
Executed by:
  • tst_qquicktextinput
144
2922 case
executed 44 times by 1 test: case 'h':
Executed by:
  • tst_qquicktextinput
'h':
executed 44 times by 1 test: case 'h':
Executed by:
  • tst_qquicktextinput
44
2923 case
executed 38 times by 1 test: case 'B':
Executed by:
  • tst_qquicktextinput
'B':
executed 38 times by 1 test: case 'B':
Executed by:
  • tst_qquicktextinput
38
2924 case
executed 38 times by 1 test: case 'b':
Executed by:
  • tst_qquicktextinput
'b':
executed 38 times by 1 test: case 'b':
Executed by:
  • tst_qquicktextinput
38
2925 s = false;-
2926 break;
executed 1984 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
1984
2927 case
executed 20 times by 1 test: case '\\':
Executed by:
  • tst_qquicktextinput
'\\':
executed 20 times by 1 test: case '\\':
Executed by:
  • tst_qquicktextinput
20
2928 escape = true;-
2929 (void)0;-
2930 default
executed 380 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
:
executed 380 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
code before this statement executed 20 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
20-380
2931 s = true;-
2932 break;
executed 400 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
400
2933 }-
2934-
2935 if (!escape
!escapeDescription
TRUEevaluated 2364 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-2364
2936 m_maskData[index].maskChar = c;-
2937 m_maskData[index].separator = s;-
2938 m_maskData[index].caseMode = m;-
2939 index++;-
2940 }
executed 2364 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2364
2941 }
executed 2384 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2384
2942 }
executed 2682 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2682
2943 internalSetText(m_text);-
2944}
executed 254 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
254
2945-
2946-
2947-
2948-
2949-
2950-
2951-
2952bool QQuickTextInputPrivate::isValidInput(QChar key, QChar mask) const-
2953{-
2954 switch (mask.unicode()) {-
2955 case
executed 1292 times by 1 test: case 'A':
Executed by:
  • tst_qquicktextinput
'A':
executed 1292 times by 1 test: case 'A':
Executed by:
  • tst_qquicktextinput
1292
2956 if (key.isLetter()
key.isLetter()Description
TRUEevaluated 850 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 442 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
442-850
2957 return
executed 850 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 850 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
850
2958 break;
executed 442 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
442
2959 case
executed 968 times by 1 test: case 'a':
Executed by:
  • tst_qquicktextinput
'a':
executed 968 times by 1 test: case 'a':
Executed by:
  • tst_qquicktextinput
968
2960 if (key.isLetter()
key.isLetter()Description
TRUEevaluated 476 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 492 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == m_blank
key == m_blankDescription
TRUEevaluated 492 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-492
2961 return
executed 968 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 968 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
968
2962 break;
never executed: break;
0
2963 case
executed 32 times by 1 test: case 'N':
Executed by:
  • tst_qquicktextinput
'N':
executed 32 times by 1 test: case 'N':
Executed by:
  • tst_qquicktextinput
32
2964 if (key.isLetterOrNumber()
key.isLetterOrNumber()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
12-20
2965 return
executed 20 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
20
2966 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
12
2967 case
executed 46 times by 1 test: case 'n':
Executed by:
  • tst_qquicktextinput
'n':
executed 46 times by 1 test: case 'n':
Executed by:
  • tst_qquicktextinput
46
2968 if (key.isLetterOrNumber()
key.isLetterOrNumber()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == m_blank
key == m_blankDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-28
2969 return
executed 46 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 46 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
46
2970 break;
never executed: break;
0
2971 case
executed 40 times by 1 test: case 'X':
Executed by:
  • tst_qquicktextinput
'X':
executed 40 times by 1 test: case 'X':
Executed by:
  • tst_qquicktextinput
40
2972 if (key.isPrint()
key.isPrint()Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-40
2973 return
executed 40 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 40 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
40
2974 break;
never executed: break;
0
2975 case
executed 28 times by 1 test: case 'x':
Executed by:
  • tst_qquicktextinput
'x':
executed 28 times by 1 test: case 'x':
Executed by:
  • tst_qquicktextinput
28
2976 if (key.isPrint()
key.isPrint()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
|| key == m_blank
key == m_blankDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-28
2977 return
executed 28 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 28 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
28
2978 break;
never executed: break;
0
2979 case
executed 1412 times by 1 test: case '9':
Executed by:
  • tst_qquicktextinput
'9':
executed 1412 times by 1 test: case '9':
Executed by:
  • tst_qquicktextinput
1412
2980 if (key.isNumber()
key.isNumber()Description
TRUEevaluated 786 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 626 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
626-786
2981 return
executed 786 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 786 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
786
2982 break;
executed 626 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
626
2983 case
executed 4130 times by 1 test: case '0':
Executed by:
  • tst_qquicktextinput
'0':
executed 4130 times by 1 test: case '0':
Executed by:
  • tst_qquicktextinput
4130
2984 if (key.isNumber()
key.isNumber()Description
TRUEevaluated 2210 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1920 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == m_blank
key == m_blankDescription
TRUEevaluated 1694 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 226 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
226-2210
2985 return
executed 3904 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 3904 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
3904
2986 break;
executed 226 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
226
2987 case
executed 48 times by 1 test: case 'D':
Executed by:
  • tst_qquicktextinput
'D':
executed 48 times by 1 test: case 'D':
Executed by:
  • tst_qquicktextinput
48
2988 if (key.isNumber()
key.isNumber()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key.digitValue() > 0
key.digitValue() > 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-24
2989 return
executed 20 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
20
2990 break;
executed 28 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
28
2991 case
executed 32 times by 1 test: case 'd':
Executed by:
  • tst_qquicktextinput
'd':
executed 32 times by 1 test: case 'd':
Executed by:
  • tst_qquicktextinput
32
2992 if ((key.isNumber()
key.isNumber()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key.digitValue() > 0
key.digitValue() > 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) || key == m_blank
key == m_blankDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-24
2993 return
executed 32 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 32 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
32
2994 break;
never executed: break;
0
2995 case
executed 6 times by 1 test: case '#':
Executed by:
  • tst_qquicktextinput
'#':
executed 6 times by 1 test: case '#':
Executed by:
  • tst_qquicktextinput
6
2996 if (key.isNumber()
key.isNumber()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == QLatin1Char('+')
key == QLatin1Char('+')Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == QLatin1Char('-')
key == QLatin1Char('-')Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == m_blank
key == m_blankDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-6
2997 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
6
2998 break;
never executed: break;
0
2999 case
executed 392 times by 1 test: case 'B':
Executed by:
  • tst_qquicktextinput
'B':
executed 392 times by 1 test: case 'B':
Executed by:
  • tst_qquicktextinput
392
3000 if (key == QLatin1Char('0')
key == QLatin1Char('0')Description
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 228 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == QLatin1Char('1')
key == QLatin1Char('1')Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
84-228
3001 return
executed 248 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 248 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
248
3002 break;
executed 144 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
144
3003 case
executed 432 times by 1 test: case 'b':
Executed by:
  • tst_qquicktextinput
'b':
executed 432 times by 1 test: case 'b':
Executed by:
  • tst_qquicktextinput
432
3004 if (key == QLatin1Char('0')
key == QLatin1Char('0')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 372 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == QLatin1Char('1')
key == QLatin1Char('1')Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 314 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| key == m_blank
key == m_blankDescription
TRUEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
58-372
3005 return
executed 272 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 272 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
272
3006 break;
executed 160 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
160
3007 case
executed 1088 times by 1 test: case 'H':
Executed by:
  • tst_qquicktextinput
'H':
executed 1088 times by 1 test: case 'H':
Executed by:
  • tst_qquicktextinput
1088
3008 if (key.isNumber()
key.isNumber()Description
TRUEevaluated 414 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 674 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| (key >= QLatin1Char('a')
key >= QLatin1Char('a')Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 386 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key <= QLatin1Char('f')
key <= QLatin1Char('f')Description
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) || (key >= QLatin1Char('A')
key >= QLatin1Char('A')Description
TRUEevaluated 338 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 128 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key <= QLatin1Char('F')
key <= QLatin1Char('F')Description
TRUEevaluated 178 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
))
80-674
3009 return
executed 800 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 800 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
800
3010 break;
executed 288 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
288
3011 case
executed 560 times by 1 test: case 'h':
Executed by:
  • tst_qquicktextinput
'h':
executed 560 times by 1 test: case 'h':
Executed by:
  • tst_qquicktextinput
560
3012 if (key.isNumber()
key.isNumber()Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 502 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| (key >= QLatin1Char('a')
key >= QLatin1Char('a')Description
TRUEevaluated 202 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 300 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key <= QLatin1Char('f')
key <= QLatin1Char('f')Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) || (key >= QLatin1Char('A')
key >= QLatin1Char('A')Description
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& key <= QLatin1Char('F')
key <= QLatin1Char('F')Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) || key == m_blank
key == m_blankDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
58-502
3013 return
executed 400 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
true;
executed 400 times by 1 test: return true;
Executed by:
  • tst_qquicktextinput
400
3014 break;
executed 160 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
160
3015 default
never executed: default:
:
never executed: default:
0
3016 break;
never executed: break;
0
3017 }-
3018 return
executed 2086 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 2086 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
2086
3019}-
3020QQuickTextInputPrivate::ValidatorState QQuickTextInputPrivate::hasAcceptableInput(const QString &str) const-
3021{-
3022-
3023 QString textCopy = str;-
3024 int cursorCopy = m_cursor;-
3025 if (m_validator
m_validatorDescription
TRUEevaluated 188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 2112 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
) {
188-2112
3026 QValidator::State state = m_validator->validate(textCopy, cursorCopy);-
3027 if (state != QValidator::Acceptable
state != QVali...or::AcceptableDescription
TRUEevaluated 120 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextinput
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
68-120
3028 return
executed 120 times by 2 tests: return ValidatorState(state);
Executed by:
  • tst_examples
  • tst_qquicktextinput
ValidatorState(state);
executed 120 times by 2 tests: return ValidatorState(state);
Executed by:
  • tst_examples
  • tst_qquicktextinput
120
3029 }
executed 68 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
68
3030-
3031-
3032 if (!m_maskData
!m_maskDataDescription
TRUEevaluated 930 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 1250 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
930-1250
3033 return
executed 930 times by 5 tests: return AcceptableInput;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
AcceptableInput;
executed 930 times by 5 tests: return AcceptableInput;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
930
3034-
3035 if (str.length() != m_maxLength
str.length() != m_maxLengthDescription
TRUEnever evaluated
FALSEevaluated 1250 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-1250
3036 return
never executed: return InvalidInput;
InvalidInput;
never executed: return InvalidInput;
0
3037-
3038 for (int i=0; i < m_maxLength
i < m_maxLengthDescription
TRUEevaluated 8450 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 662 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
662-8450
3039 if (m_maskData[i].separator
m_maskData[i].separatorDescription
TRUEevaluated 1130 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 7320 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
1130-7320
3040 if (str.at(i) != m_maskData[i].maskChar
str.at(i) != m...ta[i].maskCharDescription
TRUEnever evaluated
FALSEevaluated 1130 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-1130
3041 return
never executed: return InvalidInput;
InvalidInput;
never executed: return InvalidInput;
0
3042 }
executed 1130 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
1130
3043 if (!isValidInput(str.at(i), m_maskData[i].maskChar)
!isValidInput(...a[i].maskChar)Description
TRUEevaluated 588 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6732 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
588-6732
3044 return
executed 588 times by 1 test: return InvalidInput;
Executed by:
  • tst_qquicktextinput
InvalidInput;
executed 588 times by 1 test: return InvalidInput;
Executed by:
  • tst_qquicktextinput
588
3045 }
executed 6732 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6732
3046 }-
3047 return
executed 662 times by 1 test: return AcceptableInput;
Executed by:
  • tst_qquicktextinput
AcceptableInput;
executed 662 times by 1 test: return AcceptableInput;
Executed by:
  • tst_qquicktextinput
662
3048}-
3049QString QQuickTextInputPrivate::maskString(uint pos, const QString &str, bool clear) const-
3050{-
3051 if (pos >= (uint)m_maxLength
pos >= (uint)m_maxLengthDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1356 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
24-1356
3052 return
executed 24 times by 1 test: return QString::fromLatin1("");
Executed by:
  • tst_qquicktextinput
QString::fromLatin1("");
executed 24 times by 1 test: return QString::fromLatin1("");
Executed by:
  • tst_qquicktextinput
24
3053-
3054 QString fill;-
3055 fill = clear
clearDescription
TRUEevaluated 782 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 574 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? clearString(0, m_maxLength) : m_text;
574-782
3056-
3057 int strIndex = 0;-
3058 QString s = QString::fromLatin1("");-
3059 int i = pos;-
3060 while (i < m_maxLength
i < m_maxLengthDescription
TRUEevaluated 3598 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 216 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
216-3598
3061 if (strIndex < str.length()
strIndex < str.length()Description
TRUEevaluated 2458 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1140 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
1140-2458
3062 if (m_maskData[i].separator
m_maskData[i].separatorDescription
TRUEevaluated 188 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2270 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
188-2270
3063 s += m_maskData[i].maskChar;-
3064 if (str[strIndex] == m_maskData[i].maskChar
str[strIndex] ...ta[i].maskCharDescription
TRUEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
42-146
3065 strIndex++;
executed 146 times by 1 test: strIndex++;
Executed by:
  • tst_qquicktextinput
146
3066 ++i;-
3067 }
executed 188 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
188
3068 if (isValidInput(str[strIndex], m_maskData[i].maskChar)
isValidInput(s...a[i].maskChar)Description
TRUEevaluated 1680 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 590 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
590-1680
3069 switch (m_maskData[i].caseMode) {-
3070 case
executed 130 times by 1 test: case MaskInputData::Upper:
Executed by:
  • tst_qquicktextinput
MaskInputData::Upper:
executed 130 times by 1 test: case MaskInputData::Upper:
Executed by:
  • tst_qquicktextinput
130
3071 s += str[strIndex].toUpper();-
3072 break;
executed 130 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
130
3073 case
executed 128 times by 1 test: case MaskInputData::Lower:
Executed by:
  • tst_qquicktextinput
MaskInputData::Lower:
executed 128 times by 1 test: case MaskInputData::Lower:
Executed by:
  • tst_qquicktextinput
128
3074 s += str[strIndex].toLower();-
3075 break;
executed 128 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
128
3076 default
executed 1422 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
:
executed 1422 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
1422
3077 s += str[strIndex];-
3078 }
executed 1422 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1422
3079 ++i;-
3080 }
executed 1680 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
1680
3081-
3082 int n = findInMask(i, true, true, str[strIndex]);-
3083 if (n != -1
n != -1Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 468 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
122-468
3084 if (str.length() != 1
str.length() != 1Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| i == 0
i == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| (i > 0
i > 0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
&& (!m_maskData[i-1].separator
!m_maskData[i-1].separatorDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| m_maskData[i-1].maskChar != str[strIndex]
m_maskData[i-1... str[strIndex]Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
))) {
0-90
3085 s += fill.midRef(i, n-i+1);-
3086 i = n + 1;-
3087 }
executed 110 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
110
3088 }
executed 122 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
122
3089-
3090 n = findInMask(i, true, false, str[strIndex]);-
3091 if (n != -1
n != -1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 460 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
8-460
3092 s += fill.midRef(i, n-i);-
3093 switch (m_maskData[n].caseMode) {-
3094 case
executed 2 times by 1 test: case MaskInputData::Upper:
Executed by:
  • tst_qquicktextinput
MaskInputData::Upper:
executed 2 times by 1 test: case MaskInputData::Upper:
Executed by:
  • tst_qquicktextinput
2
3095 s += str[strIndex].toUpper();-
3096 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
2
3097 case
never executed: case MaskInputData::Lower:
MaskInputData::Lower:
never executed: case MaskInputData::Lower:
0
3098 s += str[strIndex].toLower();-
3099 break;
never executed: break;
0
3100 default
executed 6 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
:
executed 6 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
6
3101 s += str[strIndex];-
3102 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3103 i = n + 1;-
3104 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
3105 }
executed 468 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
468
3106 }-
3107 ++strIndex;-
3108 }
executed 2270 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2270
3109 } else-
3110 break;
executed 1140 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
1140
3111 }-
3112-
3113 return
executed 1356 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
s;
executed 1356 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
1356
3114}-
3115QString QQuickTextInputPrivate::clearString(uint pos, uint len) const-
3116{-
3117 if (pos >= (uint)m_maxLength
pos >= (uint)m_maxLengthDescription
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1446 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
108-1446
3118 return
executed 108 times by 1 test: return QString();
Executed by:
  • tst_qquicktextinput
QString();
executed 108 times by 1 test: return QString();
Executed by:
  • tst_qquicktextinput
108
3119-
3120 QString s;-
3121 int end = qMin((uint)m_maxLength, pos + len);-
3122 for (int i = pos; i < end
i < endDescription
TRUEevaluated 6834 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1446 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i)
1446-6834
3123 if (m_maskData[i].separator
m_maskData[i].separatorDescription
TRUEevaluated 1008 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 5826 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
1008-5826
3124 s += m_maskData[i].maskChar;
executed 1008 times by 1 test: s += m_maskData[i].maskChar;
Executed by:
  • tst_qquicktextinput
1008
3125 else-
3126 s += m_blank;
executed 5826 times by 1 test: s += m_blank;
Executed by:
  • tst_qquicktextinput
5826
3127-
3128 return
executed 1446 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
s;
executed 1446 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
1446
3129}-
3130-
3131-
3132-
3133-
3134-
3135-
3136-
3137QString QQuickTextInputPrivate::stripString(const QString &str) const-
3138{-
3139 if (!m_maskData
!m_maskDataDescription
TRUEnever evaluated
FALSEevaluated 1164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-1164
3140 return
never executed: return str;
str;
never executed: return str;
0
3141-
3142 QString s;-
3143 int end = qMin(m_maxLength, str.length());-
3144 for (int i = 0; i < end
i < endDescription
TRUEevaluated 4594 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1164 times by 1 test
Evaluated by:
  • tst_qquicktextinput
; ++i) {
1164-4594
3145 if (m_maskData[i].separator
m_maskData[i].separatorDescription
TRUEevaluated 530 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4064 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
530-4064
3146 s += m_maskData[i].maskChar;
executed 530 times by 1 test: s += m_maskData[i].maskChar;
Executed by:
  • tst_qquicktextinput
530
3147 else if (str[i] != m_blank
str[i] != m_blankDescription
TRUEevaluated 1778 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2286 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
1778-2286
3148 s += str[i];
executed 1778 times by 1 test: s += str[i];
Executed by:
  • tst_qquicktextinput
1778
3149 }
executed 4594 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4594
3150-
3151 return
executed 1164 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
s;
executed 1164 times by 1 test: return s;
Executed by:
  • tst_qquicktextinput
1164
3152}-
3153-
3154-
3155-
3156-
3157-
3158int QQuickTextInputPrivate::findInMask(int pos, bool forward, bool findSeparator, QChar searchChar) const-
3159{-
3160 if (pos >= m_maxLength
pos >= m_maxLengthDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2024 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| pos < 0
pos < 0Description
TRUEnever evaluated
FALSEevaluated 2024 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-2024
3161 return
executed 74 times by 1 test: return -1;
Executed by:
  • tst_qquicktextinput
-1;
executed 74 times by 1 test: return -1;
Executed by:
  • tst_qquicktextinput
74
3162-
3163 int end = forward
forwardDescription
TRUEevaluated 1748 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 276 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? m_maxLength : -1;
276-1748
3164 int step = forward
forwardDescription
TRUEevaluated 1748 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 276 times by 1 test
Evaluated by:
  • tst_qquicktextinput
? 1 : -1;
276-1748
3165 int i = pos;-
3166-
3167 while (i != end
i != endDescription
TRUEevaluated 3364 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 934 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
934-3364
3168 if (findSeparator
findSeparatorDescription
TRUEevaluated 1374 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1990 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
1374-1990
3169 if (m_maskData[i].separator
m_maskData[i].separatorDescription
TRUEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1190 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_maskData[i].maskChar == searchChar
m_maskData[i].... == searchCharDescription
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
62-1190
3170 return
executed 122 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
i;
executed 122 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
122
3171 }
executed 1252 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
1252
3172 if (!m_maskData[i].separator
!m_maskData[i].separatorDescription
TRUEevaluated 1876 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
114-1876
3173 if (searchChar.isNull()
searchChar.isNull()Description
TRUEevaluated 960 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 916 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
916-960
3174 return
executed 960 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
i;
executed 960 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
960
3175 else if (isValidInput(searchChar, m_maskData[i].maskChar)
isValidInput(s...a[i].maskChar)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 908 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
8-908
3176 return
executed 8 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
i;
executed 8 times by 1 test: return i;
Executed by:
  • tst_qquicktextinput
8
3177 }
executed 908 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
908
3178 }
executed 1022 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
1022
3179 i += step;-
3180 }
executed 2274 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2274
3181 return
executed 934 times by 1 test: return -1;
Executed by:
  • tst_qquicktextinput
-1;
executed 934 times by 1 test: return -1;
Executed by:
  • tst_qquicktextinput
934
3182}-
3183-
3184void QQuickTextInputPrivate::internalUndo(int until)-
3185{-
3186 if (!isUndoAvailable()
!isUndoAvailable()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 166 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
14-166
3187 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
14
3188 cancelPasswordEchoTimer();-
3189 internalDeselect();-
3190 while (m_undoState
m_undoStateDescription
TRUEevaluated 956 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_undoState > until
m_undoState > untilDescription
TRUEevaluated 946 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
10-956
3191 Command& cmd = m_history[--m_undoState];-
3192 switch (cmd.type) {-
3193 case
executed 618 times by 1 test: case Insert:
Executed by:
  • tst_qquicktextinput
Insert:
executed 618 times by 1 test: case Insert:
Executed by:
  • tst_qquicktextinput
618
3194 m_text.remove(cmd.pos, 1);-
3195 m_cursor = cmd.pos;-
3196 break;
executed 618 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
618
3197 case
executed 38 times by 1 test: case SetSelection:
Executed by:
  • tst_qquicktextinput
SetSelection:
executed 38 times by 1 test: case SetSelection:
Executed by:
  • tst_qquicktextinput
38
3198 m_selstart = cmd.selStart;-
3199 m_selend = cmd.selEnd;-
3200 m_cursor = cmd.pos;-
3201 break;
executed 38 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
38
3202 case
executed 4 times by 1 test: case Remove:
Executed by:
  • tst_qquicktextinput
Remove:
executed 4 times by 1 test: case Remove:
Executed by:
  • tst_qquicktextinput
4
3203 case
executed 102 times by 1 test: case RemoveSelection:
Executed by:
  • tst_qquicktextinput
RemoveSelection:
executed 102 times by 1 test: case RemoveSelection:
Executed by:
  • tst_qquicktextinput
102
3204 m_text.insert(cmd.pos, cmd.uc);-
3205 m_cursor = cmd.pos + 1;-
3206 break;
executed 106 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
106
3207 case
never executed: case Delete:
Delete:
never executed: case Delete:
0
3208 case
executed 108 times by 1 test: case DeleteSelection:
Executed by:
  • tst_qquicktextinput
DeleteSelection:
executed 108 times by 1 test: case DeleteSelection:
Executed by:
  • tst_qquicktextinput
108
3209 m_text.insert(cmd.pos, cmd.uc);-
3210 m_cursor = cmd.pos;-
3211 break;
executed 108 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
108
3212 case
executed 76 times by 1 test: case Separator:
Executed by:
  • tst_qquicktextinput
Separator:
executed 76 times by 1 test: case Separator:
Executed by:
  • tst_qquicktextinput
76
3213 continue;
executed 76 times by 1 test: continue;
Executed by:
  • tst_qquicktextinput
76
3214 }-
3215 if (until < 0
until < 0Description
TRUEevaluated 850 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& m_undoState
m_undoStateDescription
TRUEevaluated 798 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
20-850
3216 Command& next = m_history[m_undoState-1];-
3217 if (next.type != cmd.type
next.type != cmd.typeDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 646 times by 1 test
Evaluated by:
  • tst_qquicktextinput
152-646
3218 && next.type < RemoveSelection
next.type < RemoveSelectionDescription
TRUEevaluated 98 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qquicktextinput
54-98
3219 && (cmd.type < RemoveSelection
cmd.type < RemoveSelectionDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| next.type == Separator
next.type == SeparatorDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)) {
0-60
3220 break;
executed 98 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
98
3221 }-
3222 }
executed 700 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
700
3223 }
executed 772 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
772
3224 separate();-
3225 m_textDirty = true;-
3226}
executed 166 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
166
3227-
3228void QQuickTextInputPrivate::internalRedo()-
3229{-
3230 if (!isRedoAvailable()
!isRedoAvailable()Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-12
3231 return;
never executed: return;
0
3232 internalDeselect();-
3233 while (m_undoState < m_history.size()
m_undoState < m_history.size()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-62
3234 Command& cmd = m_history[m_undoState++];-
3235 switch (cmd.type) {-
3236 case
executed 44 times by 1 test: case Insert:
Executed by:
  • tst_qquicktextinput
Insert:
executed 44 times by 1 test: case Insert:
Executed by:
  • tst_qquicktextinput
44
3237 m_text.insert(cmd.pos, cmd.uc);-
3238 m_cursor = cmd.pos + 1;-
3239 break;
executed 44 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
44
3240 case
executed 2 times by 1 test: case SetSelection:
Executed by:
  • tst_qquicktextinput
SetSelection:
executed 2 times by 1 test: case SetSelection:
Executed by:
  • tst_qquicktextinput
2
3241 m_selstart = cmd.selStart;-
3242 m_selend = cmd.selEnd;-
3243 m_cursor = cmd.pos;-
3244 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
2
3245 case
never executed: case Remove:
Remove:
never executed: case Remove:
0
3246 case
never executed: case Delete:
Delete:
never executed: case Delete:
0
3247 case
never executed: case RemoveSelection:
RemoveSelection:
never executed: case RemoveSelection:
0
3248 case
executed 10 times by 1 test: case DeleteSelection:
Executed by:
  • tst_qquicktextinput
DeleteSelection:
executed 10 times by 1 test: case DeleteSelection:
Executed by:
  • tst_qquicktextinput
10
3249 m_text.remove(cmd.pos, 1);-
3250 m_selstart = cmd.selStart;-
3251 m_selend = cmd.selEnd;-
3252 m_cursor = cmd.pos;-
3253 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
10
3254 case
executed 6 times by 1 test: case Separator:
Executed by:
  • tst_qquicktextinput
Separator:
executed 6 times by 1 test: case Separator:
Executed by:
  • tst_qquicktextinput
6
3255 m_selstart = cmd.selStart;-
3256 m_selend = cmd.selEnd;-
3257 m_cursor = cmd.pos;-
3258 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
6
3259 }-
3260 if (m_undoState < m_history.size()
m_undoState < m_history.size()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
6-56
3261 Command& next = m_history[m_undoState];-
3262 if (next.type != cmd.type
next.type != cmd.typeDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquicktextinput
14-42
3263 && cmd.type < RemoveSelection
cmd.type < RemoveSelectionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-12
3264 && next.type != Separator
next.type != SeparatorDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
6
3265 && (next.type < RemoveSelection
next.type < RemoveSelectionDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
|| cmd.type == Separator
cmd.type == SeparatorDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0-6
3266 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
6
3267 }-
3268 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
50
3269 }
executed 56 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
56
3270 m_textDirty = true;-
3271}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
3272-
3273void QQuickTextInputPrivate::emitUndoRedoChanged()-
3274{-
3275 QQuickTextInput * const q = q_func();-
3276 const bool previousUndo = canUndo;-
3277 const bool previousRedo = canRedo;-
3278-
3279 canUndo = isUndoAvailable();-
3280 canRedo = isRedoAvailable();-
3281-
3282 if (previousUndo != canUndo
previousUndo != canUndoDescription
TRUEevaluated 474 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3246 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
474-3246
3283 q->canUndoChanged();
executed 474 times by 1 test: q->canUndoChanged();
Executed by:
  • tst_qquicktextinput
474
3284 if (previousRedo != canRedo
previousRedo != canRedoDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 3630 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
90-3630
3285 q->canRedoChanged();
executed 90 times by 1 test: q->canRedoChanged();
Executed by:
  • tst_qquicktextinput
90
3286}
executed 3720 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3720
3287-
3288-
3289-
3290-
3291-
3292-
3293-
3294bool QQuickTextInputPrivate::emitCursorPositionChanged()-
3295{-
3296 QQuickTextInput * const q = q_func();-
3297 if (m_cursor != m_lastCursorPos
m_cursor != m_lastCursorPosDescription
TRUEevaluated 4792 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 1296 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
1296-4792
3298 m_lastCursorPos = m_cursor;-
3299-
3300 q->updateCursorRectangle();-
3301 q->cursorPositionChanged();-
3302-
3303 if (!hasSelectedText()
!hasSelectedText()Description
TRUEevaluated 4200 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 592 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
592-4200
3304 if (lastSelectionStart != m_cursor
lastSelectionStart != m_cursorDescription
TRUEevaluated 3970 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 230 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
230-3970
3305 lastSelectionStart = m_cursor;-
3306 q->selectionStartChanged();-
3307 }
executed 3970 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3970
3308 if (lastSelectionEnd != m_cursor
lastSelectionEnd != m_cursorDescription
TRUEevaluated 3970 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 230 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
230-3970
3309 lastSelectionEnd = m_cursor;-
3310 q->selectionEndChanged();-
3311 }
executed 3970 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
3970
3312 }
executed 4200 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
4200
3313-
3314-
3315 if (QAccessible::isActive()
QAccessible::isActive()Description
TRUEnever evaluated
FALSEevaluated 4792 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-4792
3316 if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)
QObject *acc =...:EditableText)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3317 QAccessibleTextCursorEvent ev(acc, m_cursor);-
3318 QAccessible::updateAccessibility(&ev);-
3319 }
never executed: end of block
0
3320 }
never executed: end of block
0
3321-
3322-
3323 return
executed 4792 times by 4 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
true;
executed 4792 times by 4 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
4792
3324 }-
3325 return
executed 1296 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
false;
executed 1296 times by 1 test: return false;
Executed by:
  • tst_qquicktextinput
1296
3326}-
3327-
3328-
3329void QQuickTextInputPrivate::setBlinkingCursorEnabled(bool enable)-
3330{-
3331 if (enable == m_blinkEnabled
enable == m_blinkEnabledDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 496 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
6-496
3332 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
6
3333-
3334 m_blinkEnabled = enable;-
3335 updateCursorBlinking();-
3336-
3337 if (enable
enableDescription
TRUEevaluated 372 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 124 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
)
124-372
3338 connect((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QQuickTextInputPrivate::updateCursorBlinking);
executed 372 times by 3 tests: connect((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QQuickTextInputPrivate::updateCursorBlinking);
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
372
3339 else-
3340 disconnect((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QQuickTextInputPrivate::updateCursorBlinking);
executed 124 times by 3 tests: disconnect((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QQuickTextInputPrivate::updateCursorBlinking);
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
124
3341}-
3342-
3343void QQuickTextInputPrivate::updateCursorBlinking()-
3344{-
3345 QQuickTextInput * const q = q_func();-
3346-
3347 if (m_blinkTimer
m_blinkTimerDescription
TRUEevaluated 1868 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 1024 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
) {
1024-1868
3348 q->killTimer(m_blinkTimer);-
3349 m_blinkTimer = 0;-
3350 }
executed 1868 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
1868
3351-
3352 if (m_blinkEnabled
m_blinkEnabledDescription
TRUEevaluated 2374 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 518 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& cursorVisible
cursorVisibleDescription
TRUEevaluated 2254 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
&& !cursorItem
!cursorItemDescription
TRUEevaluated 2112 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_readOnly
!m_readOnlyDescription
TRUEevaluated 2112 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-2374
3353 int flashTime = QGuiApplication::styleHints()->cursorFlashTime();-
3354 if (flashTime >= 2
flashTime >= 2Description
TRUEevaluated 2112 times by 3 tests
Evaluated by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
)
0-2112
3355 m_blinkTimer = q->startTimer(flashTime / 2);
executed 2112 times by 3 tests: m_blinkTimer = q->startTimer(flashTime / 2);
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
2112
3356 }
executed 2112 times by 3 tests: end of block
Executed by:
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
2112
3357-
3358 m_blinkStatus = 1;-
3359 updateType = UpdatePaintNode;-
3360 q->polish();-
3361 q->update();-
3362}
executed 2892 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextinput
2892
3363-
3364void QQuickTextInput::timerEvent(QTimerEvent *event)-
3365{-
3366 QQuickTextInputPrivate * const d = d_func();-
3367 if (event->timerId() == d->m_blinkTimer
event->timerId...->m_blinkTimerDescription
TRUEevaluated 565 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-565
3368 d->m_blinkStatus = !d->m_blinkStatus;-
3369 d->updateType = QQuickTextInputPrivate::UpdatePaintNode;-
3370 polish();-
3371 update();-
3372 }
executed 565 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (event->timerId() == d->m_passwordEchoTimer.timerId()
event->timerId...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-565
3373 d->m_passwordEchoTimer.stop();-
3374 d->updateDisplayText();-
3375 updateCursorRectangle();-
3376 }
never executed: end of block
0
3377}
executed 565 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
565
3378-
3379void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)-
3380{-
3381 QQuickTextInput * const q = q_func();-
3382-
3383 if (event->key() == Qt::Key_Enter
event->key() == Qt::Key_EnterDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1966 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event->key() == Qt::Key_Return
event->key() == Qt::Key_ReturnDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1964 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
2-1966
3384 if (hasAcceptableInput(m_text) == AcceptableInput
hasAcceptableI...cceptableInputDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| fixup()
fixup()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-6
3385-
3386 QInputMethod *inputMethod = QGuiApplication::inputMethod();-
3387 inputMethod->commit();-
3388 if (!(q->inputMethodHints() & Qt::ImhMultiLine)
!(q->inputMeth...:ImhMultiLine)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-8
3389 inputMethod->hide();
executed 8 times by 1 test: inputMethod->hide();
Executed by:
  • tst_qquicktextinput
8
3390-
3391 if (activeFocus
activeFocusDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-8
3392-
3393-
3394 q->editingFinished();-
3395 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
3396-
3397 q->accepted();-
3398 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
3399 event->ignore();-
3400 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
12
3401 }-
3402-
3403 if (m_blinkEnabled
m_blinkEnabledDescription
TRUEevaluated 1870 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 94 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
)
94-1870
3404 updateCursorBlinking();
executed 1870 times by 2 tests: updateCursorBlinking();
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1870
3405-
3406 if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
m_echoMode == ...wordEchoOnEditDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1958 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
6-1958
3407 && !m_passwordEchoEditing
!m_passwordEchoEditingDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
0-6
3408 && !m_readOnly
!m_readOnlyDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
0-6
3409 && !event->text().isEmpty()
!event->text().isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
2-4
3410 && !(event->modifiers() & Qt::ControlModifier)
!(event->modif...ntrolModifier)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2
3411-
3412-
3413-
3414-
3415-
3416 updatePasswordEchoEditing(true);-
3417 clear();-
3418 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3419-
3420 bool unknown = false;-
3421-
3422 bool visual = cursorMoveStyle() == Qt::VisualMoveStyle;-
3423-
3424-
3425 if (false) {
dead code: { }
-
3426 }
dead code: { }
-
3427-
3428 else if (event == QKeySequence::Undo
event == QKeySequence::UndoDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1946 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
18-1946
3429 q->undo();-
3430 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
18
3431 else if (event == QKeySequence::Redo
event == QKeySequence::RedoDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1942 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
4-1942
3432 q->redo();-
3433 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3434 else if (event == QKeySequence::SelectAll
event == QKeyS...nce::SelectAllDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1938 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
4-1938
3435 selectAll();-
3436 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3437-
3438 else if (event == QKeySequence::Copy
event == QKeySequence::CopyDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1926 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
12-1926
3439 copy();-
3440 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
3441 else if (event == QKeySequence::Paste
event == QKeySequence::PasteDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1918 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
8-1918
3442 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-8
3443 QClipboard::Mode mode = QClipboard::Clipboard;-
3444 paste(mode);-
3445 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
3446 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
8
3447 else if (event == QKeySequence::Cut
event == QKeySequence::CutDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1914 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
4-1914
3448 q->cut();-
3449 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3450 else if (event == QKeySequence::DeleteEndOfLine
event == QKeyS...eleteEndOfLineDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1910 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
4-1910
3451 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-4
3452 deleteEndOfLine();
executed 4 times by 1 test: deleteEndOfLine();
Executed by:
  • tst_qquicktextinput
4
3453 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3454-
3455 else if (event == QKeySequence::MoveToStartOfLine
event == QKeyS...eToStartOfLineDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1818 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event == QKeySequence::MoveToStartOfBlock
event == QKeyS...ToStartOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1818 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-1818
3456 home(0);-
3457 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
92
3458 else if (event == QKeySequence::MoveToEndOfLine
event == QKeyS...oveToEndOfLineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1816 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event == QKeySequence::MoveToEndOfBlock
event == QKeyS...veToEndOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1816 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-1816
3459 end(0);-
3460 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3461 else if (event == QKeySequence::SelectStartOfLine
event == QKeyS...ectStartOfLineDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1810 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event == QKeySequence::SelectStartOfBlock
event == QKeyS...ctStartOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1810 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-1810
3462 home(1);-
3463 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3464 else if (event == QKeySequence::SelectEndOfLine
event == QKeyS...electEndOfLineDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1806 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event == QKeySequence::SelectEndOfBlock
event == QKeyS...lectEndOfBlockDescription
TRUEnever evaluated
FALSEevaluated 1806 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
0-1806
3465 end(1);-
3466 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3467 else if (event == QKeySequence::MoveToNextChar
event == QKeyS...MoveToNextCharDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1790 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
16-1790
3468 if (hasSelectedText()
hasSelectedText()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
4-12
3469 moveCursor(selectionEnd(), false);-
3470 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
4
3471 cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));-
3472 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
3473 }-
3474 else if (event == QKeySequence::SelectNextChar
event == QKeyS...SelectNextCharDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1774 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
16-1774
3475 cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));-
3476 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
3477 else if (event == QKeySequence::MoveToPreviousChar
event == QKeyS...ToPreviousCharDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1756 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
18-1756
3478 if (hasSelectedText()
hasSelectedText()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
) {
2-16
3479 moveCursor(selectionStart(), false);-
3480 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else {
2
3481 cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));-
3482 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
3483 }-
3484 else if (event == QKeySequence::SelectPreviousChar
event == QKeyS...ctPreviousCharDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1740 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
16-1740
3485 cursorForward(1, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));-
3486 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
16
3487 else if (event == QKeySequence::MoveToNextWord
event == QKeyS...MoveToNextWordDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1732 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
8-1732
3488 if (m_echoMode == QQuickTextInput::Normal
m_echoMode == ...tInput::NormalDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4
3489 layoutDirection() == Qt::LeftToRight ? cursorWordForward(0) : cursorWordBackward(0);
executed 4 times by 1 test: layoutDirection() == Qt::LeftToRight ? cursorWordForward(0) : cursorWordBackward(0);
Executed by:
  • tst_qquicktextinput
4
3490 else-
3491 layoutDirection() == Qt::LeftToRight ? end(0) : home(0);
executed 4 times by 1 test: layoutDirection() == Qt::LeftToRight ? end(0) : home(0);
Executed by:
  • tst_qquicktextinput
4
3492 }-
3493 else if (event == QKeySequence::MoveToPreviousWord
event == QKeyS...ToPreviousWordDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1720 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
12-1720
3494 if (m_echoMode == QQuickTextInput::Normal
m_echoMode == ...tInput::NormalDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
4-8
3495 layoutDirection() == Qt::LeftToRight ? cursorWordBackward(0) : cursorWordForward(0);
executed 8 times by 1 test: layoutDirection() == Qt::LeftToRight ? cursorWordBackward(0) : cursorWordForward(0);
Executed by:
  • tst_qquicktextinput
8
3496 else if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-4
3497 layoutDirection() == Qt::LeftToRight ? home(0) : end(0);-
3498 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3499 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
12
3500 else if (event == QKeySequence::SelectNextWord
event == QKeyS...SelectNextWordDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1718 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
2-1718
3501 if (m_echoMode == QQuickTextInput::Normal
m_echoMode == ...tInput::NormalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-2
3502 layoutDirection() == Qt::LeftToRight ? cursorWordForward(1) : cursorWordBackward(1);
executed 2 times by 1 test: layoutDirection() == Qt::LeftToRight ? cursorWordForward(1) : cursorWordBackward(1);
Executed by:
  • tst_qquicktextinput
2
3503 else-
3504 layoutDirection() == Qt::LeftToRight ? end(1) : home(1);
never executed: layoutDirection() == Qt::LeftToRight ? end(1) : home(1);
0
3505 }-
3506 else if (event == QKeySequence::SelectPreviousWord
event == QKeyS...ctPreviousWordDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1714 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
4-1714
3507 if (m_echoMode == QQuickTextInput::Normal
m_echoMode == ...tInput::NormalDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-4
3508 layoutDirection() == Qt::LeftToRight ? cursorWordBackward(1) : cursorWordForward(1);
executed 4 times by 1 test: layoutDirection() == Qt::LeftToRight ? cursorWordBackward(1) : cursorWordForward(1);
Executed by:
  • tst_qquicktextinput
4
3509 else-
3510 layoutDirection() == Qt::LeftToRight ? home(1) : end(1);
never executed: layoutDirection() == Qt::LeftToRight ? home(1) : end(1);
0
3511 }-
3512 else if (event == QKeySequence::Delete
event == QKeySequence::DeleteDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1692 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
22-1692
3513 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-22
3514 del();
executed 22 times by 1 test: del();
Executed by:
  • tst_qquicktextinput
22
3515 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
22
3516 else if (event == QKeySequence::DeleteEndOfWord
event == QKeyS...eleteEndOfWordDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1686 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
6-1686
3517 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-6
3518 deleteEndOfWord();
executed 6 times by 1 test: deleteEndOfWord();
Executed by:
  • tst_qquicktextinput
6
3519 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3520 else if (event == QKeySequence::DeleteStartOfWord
event == QKeyS...eteStartOfWordDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1680 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
6-1680
3521 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-6
3522 deleteStartOfWord();
executed 6 times by 1 test: deleteStartOfWord();
Executed by:
  • tst_qquicktextinput
6
3523 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
else if (event == QKeySequence::DeleteCompleteLine
event == QKeyS...teCompleteLineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1678 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
2-1678
3524 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-2
3525 selectAll();-
3526-
3527 copy();-
3528-
3529 del();-
3530 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3531 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3532-
3533 else {-
3534 bool handled = false;-
3535 if (event->modifiers() & Qt::ControlModifier
event->modifie...ontrolModifierDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1626 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
52-1626
3536 switch (event->key()) {-
3537 case
never executed: case Qt::Key_Backspace:
Qt::Key_Backspace:
never executed: case Qt::Key_Backspace:
0
3538 if (!m_readOnly
!m_readOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3539 deleteStartOfWord();
never executed: deleteStartOfWord();
0
3540 break;
never executed: break;
0
3541 default
executed 52 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
:
executed 52 times by 1 test: default:
Executed by:
  • tst_qquicktextinput
52
3542 if (!handled
!handledDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
)
0-52
3543 unknown = true;
executed 52 times by 1 test: unknown = true;
Executed by:
  • tst_qquicktextinput
52
3544 }
executed 52 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
52
3545 } else {-
3546 switch (event->key()) {-
3547 case
executed 60 times by 1 test: case Qt::Key_Backspace:
Executed by:
  • tst_qquicktextinput
Qt::Key_Backspace:
executed 60 times by 1 test: case Qt::Key_Backspace:
Executed by:
  • tst_qquicktextinput
60
3548 if (!m_readOnly
!m_readOnlyDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-60
3549 backspace();-
3550 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
60
3551 break;
executed 60 times by 1 test: break;
Executed by:
  • tst_qquicktextinput
60
3552 default
executed 1566 times by 2 tests: default:
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
:
executed 1566 times by 2 tests: default:
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1566
3553 if (!handled
!handledDescription
TRUEevaluated 1566 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEnever evaluated
)
0-1566
3554 unknown = true;
executed 1566 times by 2 tests: unknown = true;
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1566
3555 }
executed 1566 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
1566
3556 }-
3557 }-
3558-
3559 if (event->key() == Qt::Key_Direction_L
event->key() =...ey_Direction_LDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1920 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
|| event->key() == Qt::Key_Direction_R
event->key() =...ey_Direction_RDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1906 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
14-1920
3560 setLayoutDirection((event->key() == Qt::Key_Direction_L) ? Qt::LeftToRight : Qt::RightToLeft);-
3561 unknown = false;-
3562 }
executed 58 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
58
3563-
3564 if (unknown
unknownDescription
TRUEevaluated 1560 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 404 times by 1 test
Evaluated by:
  • tst_qquicktextinput
&& !m_readOnly
!m_readOnlyDescription
TRUEevaluated 1466 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 94 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
94-1560
3565 if (m_inputControl->isAcceptableInput(event)
m_inputControl...leInput(event)Description
TRUEevaluated 1360 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 106 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
) {
106-1360
3566 if (overwriteMode
overwriteModeDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 1350 times by 1 test
Evaluated by:
  • tst_qquicktextinput
10-1350
3567-
3568-
3569 && !hasSelectedText()
!hasSelectedText()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
0-10
3570 && !(m_cursor == q_func()->text().length())
!(m_cursor == ...xt().length())Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEnever evaluated
) {
0-10
3571 del();-
3572 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
10
3573-
3574 insert(event->text());-
3575 event->accept();-
3576 return;
executed 1360 times by 1 test: return;
Executed by:
  • tst_qquicktextinput
1360
3577 }-
3578 }
executed 106 times by 2 tests: end of block
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
106
3579-
3580 if (unknown
unknownDescription
TRUEevaluated 200 times by 2 tests
Evaluated by:
  • tst_qquickitem2
  • tst_qquicktextinput
FALSEevaluated 404 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
200-404
3581 event->ignore();
executed 200 times by 2 tests: event->ignore();
Executed by:
  • tst_qquickitem2
  • tst_qquicktextinput
200
3582 else-
3583 event->accept();
executed 404 times by 1 test: event->accept();
Executed by:
  • tst_qquicktextinput
404
3584}-
3585-
3586-
3587-
3588-
3589-
3590-
3591-
3592void QQuickTextInputPrivate::deleteStartOfWord()-
3593{-
3594 int priorState = m_undoState;-
3595 Command cmd(SetSelection, m_cursor, 0, m_selstart, m_selend);-
3596 separate();-
3597 cursorWordBackward(true);-
3598 addCommand(cmd);-
3599 removeSelectedText();-
3600 finishChange(priorState);-
3601}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3602-
3603-
3604-
3605-
3606-
3607-
3608-
3609void QQuickTextInputPrivate::deleteEndOfWord()-
3610{-
3611 int priorState = m_undoState;-
3612 Command cmd(SetSelection, m_cursor, 0, m_selstart, m_selend);-
3613 separate();-
3614 cursorWordForward(true);-
3615-
3616-
3617 addCommand(cmd);-
3618 removeSelectedText();-
3619 finishChange(priorState);-
3620}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3621-
3622-
3623-
3624-
3625-
3626-
3627-
3628void QQuickTextInputPrivate::deleteEndOfLine()-
3629{-
3630 int priorState = m_undoState;-
3631 Command cmd(SetSelection, m_cursor, 0, m_selstart, m_selend);-
3632 separate();-
3633 setSelection(m_cursor, end());-
3634 addCommand(cmd);-
3635 removeSelectedText();-
3636 finishChange(priorState);-
3637}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3638void QQuickTextInput::ensureVisible(int position)-
3639{-
3640 QQuickTextInputPrivate * const d = d_func();-
3641 d->ensureVisible(position);-
3642 updateCursorRectangle(false);-
3643}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3644void QQuickTextInput::clear()-
3645{-
3646 QQuickTextInputPrivate * const d = d_func();-
3647 d->resetInputMethod();-
3648 d->clear();-
3649}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
6
3650qreal QQuickTextInput::padding() const-
3651{-
3652 const QQuickTextInputPrivate * const d = d_func();-
3653 return
executed 4 times by 1 test: return d->padding();
Executed by:
  • tst_qquicktextinput
d->padding();
executed 4 times by 1 test: return d->padding();
Executed by:
  • tst_qquicktextinput
4
3654}-
3655-
3656void QQuickTextInput::setPadding(qreal padding)-
3657{-
3658 QQuickTextInputPrivate * const d = d_func();-
3659 if (qFuzzyCompare(d->padding(), padding)
qFuzzyCompare(...ng(), padding)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-4
3660 return;
never executed: return;
0
3661-
3662 d->extra.value().padding = padding;-
3663 d->updateLayout();-
3664 paddingChanged();-
3665 if (!d->extra.isAllocated()
!d->extra.isAllocated()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| !d->extra->explicitTopPadding
!d->extra->explicitTopPaddingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-4
3666 topPaddingChanged();
executed 2 times by 1 test: topPaddingChanged();
Executed by:
  • tst_qquicktextinput
2
3667 if (!d->extra.isAllocated()
!d->extra.isAllocated()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| !d->extra->explicitLeftPadding
!d->extra->explicitLeftPaddingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-4
3668 leftPaddingChanged();
executed 2 times by 1 test: leftPaddingChanged();
Executed by:
  • tst_qquicktextinput
2
3669 if (!d->extra.isAllocated()
!d->extra.isAllocated()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| !d->extra->explicitRightPadding
!d->extra->exp...itRightPaddingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-4
3670 rightPaddingChanged();
executed 2 times by 1 test: rightPaddingChanged();
Executed by:
  • tst_qquicktextinput
2
3671 if (!d->extra.isAllocated()
!d->extra.isAllocated()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextinput
|| !d->extra->explicitBottomPadding
!d->extra->exp...tBottomPaddingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
0-4
3672 bottomPaddingChanged();
executed 2 times by 1 test: bottomPaddingChanged();
Executed by:
  • tst_qquicktextinput
2
3673}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3674-
3675void QQuickTextInput::resetPadding()-
3676{-
3677 setPadding(0);-
3678}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3679-
3680qreal QQuickTextInput::topPadding() const-
3681{-
3682 const QQuickTextInputPrivate * const d = d_func();-
3683 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 434 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 24248 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
&& d->extra->explicitTopPadding
d->extra->explicitTopPaddingDescription
TRUEevaluated 356 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
78-24248
3684 return
executed 356 times by 1 test: return d->extra->topPadding;
Executed by:
  • tst_qquicktextinput
d->extra->topPadding;
executed 356 times by 1 test: return d->extra->topPadding;
Executed by:
  • tst_qquicktextinput
356
3685 return
executed 24326 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
d->padding();
executed 24326 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
24326
3686}-
3687-
3688void QQuickTextInput::setTopPadding(qreal padding)-
3689{-
3690 QQuickTextInputPrivate * const d = d_func();-
3691 d->setTopPadding(padding);-
3692}
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
3693-
3694void QQuickTextInput::resetTopPadding()-
3695{-
3696 QQuickTextInputPrivate * const d = d_func();-
3697 d->setTopPadding(0, true);-
3698}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3699-
3700qreal QQuickTextInput::leftPadding() const-
3701{-
3702 const QQuickTextInputPrivate * const d = d_func();-
3703 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 242 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 17434 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
&& d->extra->explicitLeftPadding
d->extra->explicitLeftPaddingDescription
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 184 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
58-17434
3704 return
executed 58 times by 1 test: return d->extra->leftPadding;
Executed by:
  • tst_qquicktextinput
d->extra->leftPadding;
executed 58 times by 1 test: return d->extra->leftPadding;
Executed by:
  • tst_qquicktextinput
58
3705 return
executed 17618 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
d->padding();
executed 17618 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
17618
3706}-
3707-
3708void QQuickTextInput::setLeftPadding(qreal padding)-
3709{-
3710 QQuickTextInputPrivate * const d = d_func();-
3711 d->setLeftPadding(padding);-
3712}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3713-
3714void QQuickTextInput::resetLeftPadding()-
3715{-
3716 QQuickTextInputPrivate * const d = d_func();-
3717 d->setLeftPadding(0, true);-
3718}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3719-
3720qreal QQuickTextInput::rightPadding() const-
3721{-
3722 const QQuickTextInputPrivate * const d = d_func();-
3723 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 14345 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
&& d->extra->explicitRightPadding
d->extra->explicitRightPaddingDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 180 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
60-14345
3724 return
executed 60 times by 1 test: return d->extra->rightPadding;
Executed by:
  • tst_qquicktextinput
d->extra->rightPadding;
executed 60 times by 1 test: return d->extra->rightPadding;
Executed by:
  • tst_qquicktextinput
60
3725 return
executed 14525 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
d->padding();
executed 14525 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
14525
3726}-
3727-
3728void QQuickTextInput::setRightPadding(qreal padding)-
3729{-
3730 QQuickTextInputPrivate * const d = d_func();-
3731 d->setRightPadding(padding);-
3732}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
4
3733-
3734void QQuickTextInput::resetRightPadding()-
3735{-
3736 QQuickTextInputPrivate * const d = d_func();-
3737 d->setRightPadding(0, true);-
3738}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3739-
3740qreal QQuickTextInput::bottomPadding() const-
3741{-
3742 const QQuickTextInputPrivate * const d = d_func();-
3743 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 308 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 15165 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
&& d->extra->explicitBottomPadding
d->extra->expl...tBottomPaddingDescription
TRUEevaluated 280 times by 1 test
Evaluated by:
  • tst_qquicktextinput
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquicktextinput
)
28-15165
3744 return
executed 280 times by 1 test: return d->extra->bottomPadding;
Executed by:
  • tst_qquicktextinput
d->extra->bottomPadding;
executed 280 times by 1 test: return d->extra->bottomPadding;
Executed by:
  • tst_qquicktextinput
280
3745 return
executed 15193 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
d->padding();
executed 15193 times by 5 tests: return d->padding();
Executed by:
  • tst_examples
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicktextedit
  • tst_qquicktextinput
15193
3746}-
3747-
3748void QQuickTextInput::setBottomPadding(qreal padding)-
3749{-
3750 QQuickTextInputPrivate * const d = d_func();-
3751 d->setBottomPadding(padding);-
3752}
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
14
3753-
3754void QQuickTextInput::resetBottomPadding()-
3755{-
3756 QQuickTextInputPrivate * const d = d_func();-
3757 d->setBottomPadding(0, true);-
3758}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktextinput
2
3759-
3760-
3761-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0