| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextinput.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||
| 12 | static bool qmlDisableDistanceField() { static enum { Yes, No, Unknown } status = Unknown; if (status == Unknown
never executed: }status = Yes;never executed: }end of blockexecuted 10 times by 5 tests: returnend of blockExecuted by:
executed 7132 times by 5 tests: status == Yes;return status == Yes;Executed by:
executed 7132 times by 5 tests: }return status == Yes;Executed by:
| 0-7132 | ||||||||||||||||||||||||||||||||||||
| 13 | QQuickTextInput::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 blockExecuted by:
| 1042 | ||||||||||||||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||||||||||||||
| 20 | QQuickTextInput::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 | - | |||||||||||||||||||||||||||||||||||||
| 27 | QQuickTextInput::~QQuickTextInput() | - | ||||||||||||||||||||||||||||||||||||
| 28 | { | - | ||||||||||||||||||||||||||||||||||||
| 29 | } | - | ||||||||||||||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||||||||||||||
| 31 | void 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()
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 41 | QQuickTextUtil::createCursor(d); never executed: QQuickTextUtil::createCursor(d); | 0 | ||||||||||||||||||||||||||||||||||||
| 42 | } executed 1022 times by 5 tests: end of blockExecuted by:
| 1022 | ||||||||||||||||||||||||||||||||||||
| 43 | QString QQuickTextInput::text() const | - | ||||||||||||||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||||||||||||||
| 45 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||||||||||||||
| 47 | QString content = d->m_text; | - | ||||||||||||||||||||||||||||||||||||
| 48 | QString res = d->m_maskData
| 1164-3310 | ||||||||||||||||||||||||||||||||||||
| 49 | return executed 4474 times by 4 tests: (res.isNull() ? QString::fromLatin1("") : res);return (res.isNull() ? QString::fromLatin1("") : res);Executed by:
executed 4474 times by 4 tests: return (res.isNull() ? QString::fromLatin1("") : res);Executed by:
| 4474 | ||||||||||||||||||||||||||||||||||||
| 50 | } | - | ||||||||||||||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||||||||||||||
| 52 | void QQuickTextInput::setText(const QString &s) | - | ||||||||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||||||||
| 54 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 55 | if (s == text()
| 36-1244 | ||||||||||||||||||||||||||||||||||||
| 56 | return; executed 36 times by 2 tests: return;Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||||||||
| 59 | d->cancelPreedit(); | - | ||||||||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||||||||
| 61 | d->internalSetText(s, -1, false); | - | ||||||||||||||||||||||||||||||||||||
| 62 | } executed 1244 times by 4 tests: end of blockExecuted by:
| 1244 | ||||||||||||||||||||||||||||||||||||
| 63 | QQuickTextInput::RenderType QQuickTextInput::renderType() const | - | ||||||||||||||||||||||||||||||||||||
| 64 | { | - | ||||||||||||||||||||||||||||||||||||
| 65 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 66 | return executed 6 times by 1 test: d->renderType;return d->renderType;Executed by:
executed 6 times by 1 test: return d->renderType;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 67 | } | - | ||||||||||||||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||||||||||||||
| 69 | void QQuickTextInput::setRenderType(QQuickTextInput::RenderType renderType) | - | ||||||||||||||||||||||||||||||||||||
| 70 | { | - | ||||||||||||||||||||||||||||||||||||
| 71 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 72 | if (d->renderType == renderType
| 2-4 | ||||||||||||||||||||||||||||||||||||
| 73 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||||||||
| 75 | d->renderType = renderType; | - | ||||||||||||||||||||||||||||||||||||
| 76 | renderTypeChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||||||||
| 78 | if (isComponentComplete()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 79 | d->updateLayout(); executed 4 times by 1 test: d->updateLayout();Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 80 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 81 | int QQuickTextInput::length() const | - | ||||||||||||||||||||||||||||||||||||
| 82 | { | - | ||||||||||||||||||||||||||||||||||||
| 83 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 84 | return executed 166 times by 1 test: d->m_text.length();return d->m_text.length();Executed by:
executed 166 times by 1 test: return d->m_text.length();Executed by:
| 166 | ||||||||||||||||||||||||||||||||||||
| 85 | } | - | ||||||||||||||||||||||||||||||||||||
| 86 | QString QQuickTextInput::getText(int start, int end) const | - | ||||||||||||||||||||||||||||||||||||
| 87 | { | - | ||||||||||||||||||||||||||||||||||||
| 88 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||||||||
| 90 | if (start > end
| 2-50 | ||||||||||||||||||||||||||||||||||||
| 91 | qSwap(start, end); executed 2 times by 1 test: qSwap(start, end);Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||||||||||||||
| 93 | return executed 52 times by 1 test: d->m_text.mid(start, end - start);return d->m_text.mid(start, end - start);Executed by:
executed 52 times by 1 test: return d->m_text.mid(start, end - start);Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||
| 94 | } | - | ||||||||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||||||||
| 96 | QString QQuickTextInputPrivate::realText() const | - | ||||||||||||||||||||||||||||||||||||
| 97 | { | - | ||||||||||||||||||||||||||||||||||||
| 98 | QString res = m_maskData
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 99 | return executed 4 times by 1 test: (res.isNull() ? QString::fromLatin1("") : res);return (res.isNull() ? QString::fromLatin1("") : res);Executed by:
executed 4 times by 1 test: return (res.isNull() ? QString::fromLatin1("") : res);Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 100 | } | - | ||||||||||||||||||||||||||||||||||||
| 101 | QFont QQuickTextInput::font() const | - | ||||||||||||||||||||||||||||||||||||
| 102 | { | - | ||||||||||||||||||||||||||||||||||||
| 103 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 104 | return executed 178 times by 2 tests: d->sourceFont;return d->sourceFont;Executed by:
executed 178 times by 2 tests: return d->sourceFont;Executed by:
| 178 | ||||||||||||||||||||||||||||||||||||
| 105 | } | - | ||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||
| 107 | void QQuickTextInput::setFont(const QFont &font) | - | ||||||||||||||||||||||||||||||||||||
| 108 | { | - | ||||||||||||||||||||||||||||||||||||
| 109 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 110 | if (d->sourceFont == font
| 14-32 | ||||||||||||||||||||||||||||||||||||
| 111 | return; executed 14 times by 1 test: return;Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||||||||||||||
| 113 | d->sourceFont = font; | - | ||||||||||||||||||||||||||||||||||||
| 114 | QFont oldFont = d->font; | - | ||||||||||||||||||||||||||||||||||||
| 115 | d->font = font; | - | ||||||||||||||||||||||||||||||||||||
| 116 | if (d->font.pointSizeF() != -1
| 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 blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 121 | if (oldFont != d->font
| 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 blockExecuted by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 128 | fontChanged(d->sourceFont); | - | ||||||||||||||||||||||||||||||||||||
| 129 | } executed 32 times by 2 tests: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||||||||||||||
| 136 | QColor QQuickTextInput::color() const | - | ||||||||||||||||||||||||||||||||||||
| 137 | { | - | ||||||||||||||||||||||||||||||||||||
| 138 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 139 | return executed 32 times by 1 test: d->color;return d->color;Executed by:
executed 32 times by 1 test: return d->color;Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 140 | } | - | ||||||||||||||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||||||||||||||
| 142 | void QQuickTextInput::setColor(const QColor &c) | - | ||||||||||||||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||||||||||||||
| 144 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 145 | if (c != d->color
| 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 blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 153 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||||||||
| 161 | QColor QQuickTextInput::selectionColor() const | - | ||||||||||||||||||||||||||||||||||||
| 162 | { | - | ||||||||||||||||||||||||||||||||||||
| 163 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 164 | return executed 30 times by 1 test: d->selectionColor;return d->selectionColor;Executed by:
executed 30 times by 1 test: return d->selectionColor;Executed by:
| 30 | ||||||||||||||||||||||||||||||||||||
| 165 | } | - | ||||||||||||||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||||||||||||||
| 167 | void QQuickTextInput::setSelectionColor(const QColor &color) | - | ||||||||||||||||||||||||||||||||||||
| 168 | { | - | ||||||||||||||||||||||||||||||||||||
| 169 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 170 | if (d->selectionColor == color
| 2-28 | ||||||||||||||||||||||||||||||||||||
| 171 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||||||||||||||
| 173 | d->selectionColor = color; | - | ||||||||||||||||||||||||||||||||||||
| 174 | if (d->hasSelectedText()
| 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 blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||||||||
| 187 | QColor QQuickTextInput::selectedTextColor() const | - | ||||||||||||||||||||||||||||||||||||
| 188 | { | - | ||||||||||||||||||||||||||||||||||||
| 189 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 190 | return executed 30 times by 1 test: d->selectedTextColor;return d->selectedTextColor;Executed by:
executed 30 times by 1 test: return d->selectedTextColor;Executed by:
| 30 | ||||||||||||||||||||||||||||||||||||
| 191 | } | - | ||||||||||||||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||||||||||||||
| 193 | void QQuickTextInput::setSelectedTextColor(const QColor &color) | - | ||||||||||||||||||||||||||||||||||||
| 194 | { | - | ||||||||||||||||||||||||||||||||||||
| 195 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 196 | if (d->selectedTextColor == color
| 4-26 | ||||||||||||||||||||||||||||||||||||
| 197 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||||||||||||||
| 199 | d->selectedTextColor = color; | - | ||||||||||||||||||||||||||||||||||||
| 200 | if (d->hasSelectedText()
| 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 blockExecuted by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 208 | QQuickTextInput::HAlignment QQuickTextInput::hAlign() const | - | ||||||||||||||||||||||||||||||||||||
| 209 | { | - | ||||||||||||||||||||||||||||||||||||
| 210 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 211 | return executed 66 times by 2 tests: d->hAlign;return d->hAlign;Executed by:
executed 66 times by 2 tests: return d->hAlign;Executed by:
| 66 | ||||||||||||||||||||||||||||||||||||
| 212 | } | - | ||||||||||||||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||||||||||||||
| 214 | void QQuickTextInput::setHAlign(HAlignment align) | - | ||||||||||||||||||||||||||||||||||||
| 215 | { | - | ||||||||||||||||||||||||||||||||||||
| 216 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 217 | bool forceAlign = d->hAlignImplicit
| 2-28 | ||||||||||||||||||||||||||||||||||||
| 218 | d->hAlignImplicit = false; | - | ||||||||||||||||||||||||||||||||||||
| 219 | if (d->setHAlign(align, forceAlign)
| 0-28 | ||||||||||||||||||||||||||||||||||||
| 220 | d->updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 221 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 222 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 223 | } executed 34 times by 1 test: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||||||||||||||
| 225 | void QQuickTextInput::resetHAlign() | - | ||||||||||||||||||||||||||||||||||||
| 226 | { | - | ||||||||||||||||||||||||||||||||||||
| 227 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 228 | d->hAlignImplicit = true; | - | ||||||||||||||||||||||||||||||||||||
| 229 | if (d->determineHorizontalAlignment()
| 0-16 | ||||||||||||||||||||||||||||||||||||
| 230 | d->updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 231 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 232 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 233 | } executed 20 times by 2 tests: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||||||||||||||
| 235 | QQuickTextInput::HAlignment QQuickTextInput::effectiveHAlign() const | - | ||||||||||||||||||||||||||||||||||||
| 236 | { | - | ||||||||||||||||||||||||||||||||||||
| 237 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 238 | QQuickTextInput::HAlignment effectiveAlignment = d->hAlign; | - | ||||||||||||||||||||||||||||||||||||
| 239 | if (!d->hAlignImplicit
| 22-6190 | ||||||||||||||||||||||||||||||||||||
| 240 | switch (d->hAlign) { | - | ||||||||||||||||||||||||||||||||||||
| 241 | case executed 10 times by 1 test: QQuickTextInput::AlignLeft:case QQuickTextInput::AlignLeft:Executed by:
executed 10 times by 1 test: case QQuickTextInput::AlignLeft:Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 242 | effectiveAlignment = QQuickTextInput::AlignRight; | - | ||||||||||||||||||||||||||||||||||||
| 243 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 244 | case executed 12 times by 1 test: QQuickTextInput::AlignRight:case QQuickTextInput::AlignRight:Executed by:
executed 12 times by 1 test: case QQuickTextInput::AlignRight:Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 245 | effectiveAlignment = QQuickTextInput::AlignLeft; | - | ||||||||||||||||||||||||||||||||||||
| 246 | break; executed 12 times by 1 test: break;Executed by:
| 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: effectiveAlignment;return effectiveAlignment;Executed by:
executed 6350 times by 5 tests: return effectiveAlignment;Executed by:
| 6350 | ||||||||||||||||||||||||||||||||||||
| 252 | } | - | ||||||||||||||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||||||||||||||
| 254 | bool QQuickTextInputPrivate::setHAlign(QQuickTextInput::HAlignment alignment, bool forceAlign) | - | ||||||||||||||||||||||||||||||||||||
| 255 | { | - | ||||||||||||||||||||||||||||||||||||
| 256 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 257 | if ((hAlign != alignment
| 0-4724 | ||||||||||||||||||||||||||||||||||||
| 258 | QQuickTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign(); | - | ||||||||||||||||||||||||||||||||||||
| 259 | hAlign = alignment; | - | ||||||||||||||||||||||||||||||||||||
| 260 | q->horizontalAlignmentChanged(alignment); | - | ||||||||||||||||||||||||||||||||||||
| 261 | if (oldEffectiveHAlign != q->effectiveHAlign()
| 2-66 | ||||||||||||||||||||||||||||||||||||
| 262 | q->effectiveHorizontalAlignmentChanged(); executed 66 times by 2 tests: q->effectiveHorizontalAlignmentChanged();Executed by:
| 66 | ||||||||||||||||||||||||||||||||||||
| 263 | return executed 68 times by 2 tests: true;return true;Executed by:
executed 68 times by 2 tests: return true;Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||
| 264 | } | - | ||||||||||||||||||||||||||||||||||||
| 265 | return executed 4722 times by 5 tests: false;return false;Executed by:
executed 4722 times by 5 tests: return false;Executed by:
| 4722 | ||||||||||||||||||||||||||||||||||||
| 266 | } | - | ||||||||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||||||||
| 268 | Qt::LayoutDirection QQuickTextInputPrivate::textDirection() const | - | ||||||||||||||||||||||||||||||||||||
| 269 | { | - | ||||||||||||||||||||||||||||||||||||
| 270 | QString text = m_text; | - | ||||||||||||||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||||||||||||||
| 272 | if (text.isEmpty()
| 1816-9088 | ||||||||||||||||||||||||||||||||||||
| 273 | text = m_textLayout.preeditAreaText(); executed 1816 times by 5 tests: text = m_textLayout.preeditAreaText();Executed by:
| 1816 | ||||||||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||||||||
| 276 | const QChar *character = text.constData(); | - | ||||||||||||||||||||||||||||||||||||
| 277 | while (!character->isNull()
| 3858-25808 | ||||||||||||||||||||||||||||||||||||
| 278 | switch (character->direction()) { | - | ||||||||||||||||||||||||||||||||||||
| 279 | case executed 6958 times by 4 tests: QChar::DirL:case QChar::DirL:Executed by:
executed 6958 times by 4 tests: case QChar::DirL:Executed by:
| 6958 | ||||||||||||||||||||||||||||||||||||
| 280 | return executed 6958 times by 4 tests: Qt::LeftToRight;return Qt::LeftToRight;Executed by:
executed 6958 times by 4 tests: return Qt::LeftToRight;Executed by:
| 6958 | ||||||||||||||||||||||||||||||||||||
| 281 | case never executed: QChar::DirR:case QChar::DirR:never executed: case QChar::DirR: | 0 | ||||||||||||||||||||||||||||||||||||
| 282 | case executed 88 times by 2 tests: QChar::DirAL:case QChar::DirAL:Executed by:
executed 88 times by 2 tests: case QChar::DirAL:Executed by:
| 88 | ||||||||||||||||||||||||||||||||||||
| 283 | case never executed: QChar::DirAN:case QChar::DirAN:never executed: case QChar::DirAN: | 0 | ||||||||||||||||||||||||||||||||||||
| 284 | return executed 88 times by 2 tests: Qt::RightToLeft;return Qt::RightToLeft;Executed by:
executed 88 times by 2 tests: return Qt::RightToLeft;Executed by:
| 88 | ||||||||||||||||||||||||||||||||||||
| 285 | default executed 18762 times by 2 tests: :default:Executed by:
executed 18762 times by 2 tests: default:Executed by:
| 18762 | ||||||||||||||||||||||||||||||||||||
| 286 | break; executed 18762 times by 2 tests: break;Executed by:
| 18762 | ||||||||||||||||||||||||||||||||||||
| 287 | } | - | ||||||||||||||||||||||||||||||||||||
| 288 | character++; | - | ||||||||||||||||||||||||||||||||||||
| 289 | } executed 18762 times by 2 tests: end of blockExecuted by:
| 18762 | ||||||||||||||||||||||||||||||||||||
| 290 | return executed 3858 times by 5 tests: Qt::LayoutDirectionAuto;return Qt::LayoutDirectionAuto;Executed by:
executed 3858 times by 5 tests: return Qt::LayoutDirectionAuto;Executed by:
| 3858 | ||||||||||||||||||||||||||||||||||||
| 291 | } | - | ||||||||||||||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||||||||||||||
| 293 | Qt::LayoutDirection QQuickTextInputPrivate::layoutDirection() const | - | ||||||||||||||||||||||||||||||||||||
| 294 | { | - | ||||||||||||||||||||||||||||||||||||
| 295 | Qt::LayoutDirection direction = m_layoutDirection; | - | ||||||||||||||||||||||||||||||||||||
| 296 | if (direction == Qt::LayoutDirectionAuto
| 58-6148 | ||||||||||||||||||||||||||||||||||||
| 297 | direction = textDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||||||||||||||
| 299 | if (direction == Qt::LayoutDirectionAuto
| 1674-4474 | ||||||||||||||||||||||||||||||||||||
| 300 | direction = QGuiApplication::inputMethod()->inputDirection(); executed 1674 times by 5 tests: direction = QGuiApplication::inputMethod()->inputDirection();Executed by:
| 1674 | ||||||||||||||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||||||||||||||
| 302 | } executed 6148 times by 5 tests: end of blockExecuted by:
| 6148 | ||||||||||||||||||||||||||||||||||||
| 303 | return executed 6206 times by 5 tests: (direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;return (direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;Executed by:
executed 6206 times by 5 tests: return (direction == Qt::LayoutDirectionAuto) ? Qt::LeftToRight : direction;Executed by:
| 6206 | ||||||||||||||||||||||||||||||||||||
| 304 | } | - | ||||||||||||||||||||||||||||||||||||
| 305 | - | |||||||||||||||||||||||||||||||||||||
| 306 | bool QQuickTextInputPrivate::determineHorizontalAlignment() | - | ||||||||||||||||||||||||||||||||||||
| 307 | { | - | ||||||||||||||||||||||||||||||||||||
| 308 | if (hAlignImplicit
| 16-4756 | ||||||||||||||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||||||||||||||
| 310 | Qt::LayoutDirection direction = textDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||||||||
| 312 | if (direction == Qt::LayoutDirectionAuto
| 2184-2572 | ||||||||||||||||||||||||||||||||||||
| 313 | direction = QGuiApplication::inputMethod()->inputDirection(); executed 2184 times by 5 tests: direction = QGuiApplication::inputMethod()->inputDirection();Executed by:
| 2184 | ||||||||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||||||||
| 315 | return executed 4756 times by 5 tests: setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);return setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);Executed by:
executed 4756 times by 5 tests: return setHAlign(direction == Qt::RightToLeft ? QQuickTextInput::AlignRight : QQuickTextInput::AlignLeft);Executed by:
| 4756 | ||||||||||||||||||||||||||||||||||||
| 316 | } | - | ||||||||||||||||||||||||||||||||||||
| 317 | return executed 16 times by 1 test: false;return false;Executed by:
executed 16 times by 1 test: return false;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 318 | } | - | ||||||||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||||||||
| 320 | QQuickTextInput::VAlignment QQuickTextInput::vAlign() const | - | ||||||||||||||||||||||||||||||||||||
| 321 | { | - | ||||||||||||||||||||||||||||||||||||
| 322 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 323 | return executed 6 times by 1 test: d->vAlign;return d->vAlign;Executed by:
executed 6 times by 1 test: return d->vAlign;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 324 | } | - | ||||||||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||||||||
| 326 | void QQuickTextInput::setVAlign(QQuickTextInput::VAlignment alignment) | - | ||||||||||||||||||||||||||||||||||||
| 327 | { | - | ||||||||||||||||||||||||||||||||||||
| 328 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 329 | if (alignment == d->vAlign
| 4-20 | ||||||||||||||||||||||||||||||||||||
| 330 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 331 | d->vAlign = alignment; | - | ||||||||||||||||||||||||||||||||||||
| 332 | verticalAlignmentChanged(d->vAlign); | - | ||||||||||||||||||||||||||||||||||||
| 333 | if (isComponentComplete()
| 8-12 | ||||||||||||||||||||||||||||||||||||
| 334 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 335 | d->updateBaselineOffset(); | - | ||||||||||||||||||||||||||||||||||||
| 336 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 337 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 338 | QQuickTextInput::WrapMode QQuickTextInput::wrapMode() const | - | ||||||||||||||||||||||||||||||||||||
| 339 | { | - | ||||||||||||||||||||||||||||||||||||
| 340 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 341 | return executed 8 times by 1 test: d->wrapMode;return d->wrapMode;Executed by:
executed 8 times by 1 test: return d->wrapMode;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 342 | } | - | ||||||||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||||||||
| 344 | void QQuickTextInput::setWrapMode(WrapMode mode) | - | ||||||||||||||||||||||||||||||||||||
| 345 | { | - | ||||||||||||||||||||||||||||||||||||
| 346 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 347 | if (mode == d->wrapMode
| 6-42 | ||||||||||||||||||||||||||||||||||||
| 348 | return; executed 6 times by 1 test: return;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 349 | d->wrapMode = mode; | - | ||||||||||||||||||||||||||||||||||||
| 350 | d->updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 351 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 352 | wrapModeChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 353 | } executed 42 times by 1 test: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||||||||||||||
| 355 | void QQuickTextInputPrivate::mirrorChange() | - | ||||||||||||||||||||||||||||||||||||
| 356 | { | - | ||||||||||||||||||||||||||||||||||||
| 357 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 358 | if (q->isComponentComplete()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 359 | if (!hAlignImplicit
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 360 | q->updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 361 | q->effectiveHorizontalAlignmentChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 362 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 363 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 364 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 365 | bool QQuickTextInput::isReadOnly() const | - | ||||||||||||||||||||||||||||||||||||
| 366 | { | - | ||||||||||||||||||||||||||||||||||||
| 367 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 368 | return executed 305 times by 4 tests: d->m_readOnly;return d->m_readOnly;Executed by:
executed 305 times by 4 tests: return d->m_readOnly;Executed by:
| 305 | ||||||||||||||||||||||||||||||||||||
| 369 | } | - | ||||||||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||||||||
| 371 | void QQuickTextInput::setReadOnly(bool ro) | - | ||||||||||||||||||||||||||||||||||||
| 372 | { | - | ||||||||||||||||||||||||||||||||||||
| 373 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 374 | if (d->m_readOnly == ro
| 2-38 | ||||||||||||||||||||||||||||||||||||
| 375 | return; executed 2 times by 1 test: return;Executed by:
| 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
| 14-24 | ||||||||||||||||||||||||||||||||||||
| 389 | setCursorVisible(false); | - | ||||||||||||||||||||||||||||||||||||
| 390 | } executed 24 times by 2 tests: else if (hasActiveFocus()end of blockExecuted by:
| 4-24 | ||||||||||||||||||||||||||||||||||||
| 391 | setCursorVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 392 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 393 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 394 | } executed 38 times by 2 tests: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||||||||||||||
| 395 | int QQuickTextInput::maxLength() const | - | ||||||||||||||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||||||||||||||
| 397 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 398 | return executed 2 times by 1 test: d->m_maxLength;return d->m_maxLength;Executed by:
executed 2 times by 1 test: return d->m_maxLength;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 399 | } | - | ||||||||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||||||||
| 401 | void QQuickTextInput::setMaxLength(int ml) | - | ||||||||||||||||||||||||||||||||||||
| 402 | { | - | ||||||||||||||||||||||||||||||||||||
| 403 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 404 | if (d->m_maxLength == ml
| 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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 412 | bool QQuickTextInput::isCursorVisible() const | - | ||||||||||||||||||||||||||||||||||||
| 413 | { | - | ||||||||||||||||||||||||||||||||||||
| 414 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 415 | return executed 58 times by 1 test: d->cursorVisible;return d->cursorVisible;Executed by:
executed 58 times by 1 test: return d->cursorVisible;Executed by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 416 | } | - | ||||||||||||||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||||||||||||||
| 418 | void QQuickTextInput::setCursorVisible(bool on) | - | ||||||||||||||||||||||||||||||||||||
| 419 | { | - | ||||||||||||||||||||||||||||||||||||
| 420 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 421 | if (d->cursorVisible == on
| 360-542 | ||||||||||||||||||||||||||||||||||||
| 422 | return; executed 360 times by 2 tests: return;Executed by:
| 360 | ||||||||||||||||||||||||||||||||||||
| 423 | d->cursorVisible = on; | - | ||||||||||||||||||||||||||||||||||||
| 424 | if (on
| 14-404 | ||||||||||||||||||||||||||||||||||||
| 425 | QQuickTextUtil::createCursor(d); executed 390 times by 3 tests: QQuickTextUtil::createCursor(d);Executed by:
| 390 | ||||||||||||||||||||||||||||||||||||
| 426 | if (!d->cursorItem
| 42-500 | ||||||||||||||||||||||||||||||||||||
| 427 | d->updateCursorBlinking(); executed 500 times by 4 tests: d->updateCursorBlinking();Executed by:
| 500 | ||||||||||||||||||||||||||||||||||||
| 428 | cursorVisibleChanged(d->cursorVisible); | - | ||||||||||||||||||||||||||||||||||||
| 429 | } executed 542 times by 4 tests: end of blockExecuted by:
| 542 | ||||||||||||||||||||||||||||||||||||
| 430 | - | |||||||||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||||||||||||||
| 434 | - | |||||||||||||||||||||||||||||||||||||
| 435 | int QQuickTextInput::cursorPosition() const | - | ||||||||||||||||||||||||||||||||||||
| 436 | { | - | ||||||||||||||||||||||||||||||||||||
| 437 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 438 | return executed 382 times by 1 test: d->m_cursor;return d->m_cursor;Executed by:
executed 382 times by 1 test: return d->m_cursor;Executed by:
| 382 | ||||||||||||||||||||||||||||||||||||
| 439 | } | - | ||||||||||||||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||||||||||||||
| 441 | void QQuickTextInput::setCursorPosition(int cp) | - | ||||||||||||||||||||||||||||||||||||
| 442 | { | - | ||||||||||||||||||||||||||||||||||||
| 443 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 444 | if (cp < 0
| 2-916 | ||||||||||||||||||||||||||||||||||||
| 445 | return; executed 10 times by 1 test: return;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 446 | d->moveCursor(cp); | - | ||||||||||||||||||||||||||||||||||||
| 447 | } executed 908 times by 1 test: end of blockExecuted by:
| 908 | ||||||||||||||||||||||||||||||||||||
| 448 | QRectF 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
| 2-2720 | ||||||||||||||||||||||||||||||||||||
| 457 | c = 0; executed 2 times by 1 test: c = 0;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 458 | QTextLine l = d->m_textLayout.lineForTextPosition(c); | - | ||||||||||||||||||||||||||||||||||||
| 459 | if (!l.isValid()
| 0-2722 | ||||||||||||||||||||||||||||||||||||
| 460 | return never executed: QRectF();return 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
| 0-2722 | ||||||||||||||||||||||||||||||||||||
| 465 | if (c < text().length()
| 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: QRectF(x, y, w, l.height());return QRectF(x, y, w, l.height());Executed by:
executed 2722 times by 4 tests: return QRectF(x, y, w, l.height());Executed by:
| 2722 | ||||||||||||||||||||||||||||||||||||
| 471 | } | - | ||||||||||||||||||||||||||||||||||||
| 472 | int QQuickTextInput::selectionStart() const | - | ||||||||||||||||||||||||||||||||||||
| 473 | { | - | ||||||||||||||||||||||||||||||||||||
| 474 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 475 | return executed 588 times by 1 test: d->lastSelectionStart;return d->lastSelectionStart;Executed by:
executed 588 times by 1 test: return d->lastSelectionStart;Executed by:
| 588 | ||||||||||||||||||||||||||||||||||||
| 476 | } | - | ||||||||||||||||||||||||||||||||||||
| 477 | int QQuickTextInput::selectionEnd() const | - | ||||||||||||||||||||||||||||||||||||
| 478 | { | - | ||||||||||||||||||||||||||||||||||||
| 479 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 480 | return executed 586 times by 1 test: d->lastSelectionEnd;return d->lastSelectionEnd;Executed by:
executed 586 times by 1 test: return d->lastSelectionEnd;Executed by:
| 586 | ||||||||||||||||||||||||||||||||||||
| 481 | } | - | ||||||||||||||||||||||||||||||||||||
| 482 | void QQuickTextInput::select(int start, int end) | - | ||||||||||||||||||||||||||||||||||||
| 483 | { | - | ||||||||||||||||||||||||||||||||||||
| 484 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 485 | if (start < 0
| 4-418 | ||||||||||||||||||||||||||||||||||||
| 486 | return; executed 16 times by 1 test: return;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 487 | d->setSelection(start, end-start); | - | ||||||||||||||||||||||||||||||||||||
| 488 | } executed 406 times by 1 test: end of blockExecuted by:
| 406 | ||||||||||||||||||||||||||||||||||||
| 489 | QString QQuickTextInput::selectedText() const | - | ||||||||||||||||||||||||||||||||||||
| 490 | { | - | ||||||||||||||||||||||||||||||||||||
| 491 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 492 | return executed 892 times by 1 test: d->selectedText();return d->selectedText();Executed by:
executed 892 times by 1 test: return d->selectedText();Executed by:
| 892 | ||||||||||||||||||||||||||||||||||||
| 493 | } | - | ||||||||||||||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||||||||||||||
| 498 | - | |||||||||||||||||||||||||||||||||||||
| 499 | - | |||||||||||||||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||||||||||||||
| 501 | bool QQuickTextInput::focusOnPress() const | - | ||||||||||||||||||||||||||||||||||||
| 502 | { | - | ||||||||||||||||||||||||||||||||||||
| 503 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 504 | return executed 12 times by 1 test: d->focusOnPress;return d->focusOnPress;Executed by:
executed 12 times by 1 test: return d->focusOnPress;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 505 | } | - | ||||||||||||||||||||||||||||||||||||
| 506 | - | |||||||||||||||||||||||||||||||||||||
| 507 | void QQuickTextInput::setFocusOnPress(bool b) | - | ||||||||||||||||||||||||||||||||||||
| 508 | { | - | ||||||||||||||||||||||||||||||||||||
| 509 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 510 | if (d->focusOnPress == b
| 12-16 | ||||||||||||||||||||||||||||||||||||
| 511 | return; executed 16 times by 1 test: return;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||||||||||||||
| 513 | d->focusOnPress = b; | - | ||||||||||||||||||||||||||||||||||||
| 514 | - | |||||||||||||||||||||||||||||||||||||
| 515 | activeFocusOnPressChanged(d->focusOnPress); | - | ||||||||||||||||||||||||||||||||||||
| 516 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 517 | bool QQuickTextInput::autoScroll() const | - | ||||||||||||||||||||||||||||||||||||
| 518 | { | - | ||||||||||||||||||||||||||||||||||||
| 519 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 520 | return never executed: d->autoScroll;return d->autoScroll;never executed: return d->autoScroll; | 0 | ||||||||||||||||||||||||||||||||||||
| 521 | } | - | ||||||||||||||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||||||||||||||
| 523 | void QQuickTextInput::setAutoScroll(bool b) | - | ||||||||||||||||||||||||||||||||||||
| 524 | { | - | ||||||||||||||||||||||||||||||||||||
| 525 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 526 | if (d->autoScroll == b
| 2-18 | ||||||||||||||||||||||||||||||||||||
| 527 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 528 | - | |||||||||||||||||||||||||||||||||||||
| 529 | d->autoScroll = b; | - | ||||||||||||||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||||||||||||||
| 531 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 532 | autoScrollChanged(d->autoScroll); | - | ||||||||||||||||||||||||||||||||||||
| 533 | } executed 18 times by 1 test: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 534 | QValidator* QQuickTextInput::validator() const | - | ||||||||||||||||||||||||||||||||||||
| 535 | { | - | ||||||||||||||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||||||||
| 539 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 540 | return executed 18 times by 1 test: d->m_validator;return d->m_validator;Executed by:
executed 18 times by 1 test: return d->m_validator;Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 541 | - | |||||||||||||||||||||||||||||||||||||
| 542 | } | - | ||||||||||||||||||||||||||||||||||||
| 543 | - | |||||||||||||||||||||||||||||||||||||
| 544 | void QQuickTextInput::setValidator(QValidator* v) | - | ||||||||||||||||||||||||||||||||||||
| 545 | { | - | ||||||||||||||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||||||||||||||
| 547 | - | |||||||||||||||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||||||||||||||
| 549 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 550 | if (d->m_validator == v
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 551 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||||||||||||||
| 553 | if (d->m_validator
| 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
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||||||||||||||
| 556 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 557 | , | - | ||||||||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||||||||
| 559 | 1049 | - | ||||||||||||||||||||||||||||||||||||
| 560 | )); signalIdx = QValidator::staticMetaObject.indexOfSignal(signal+1); } executed 2 times by 1 test: if (methodIdx < 0end of blockExecuted by:
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||||||||||||||
| 562 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 563 | , | - | ||||||||||||||||||||||||||||||||||||
| 564 | - | |||||||||||||||||||||||||||||||||||||
| 565 | 1049 | - | ||||||||||||||||||||||||||||||||||||
| 566 | )); if (code == 1
executed 2 times by 1 test: else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);Executed by:
never executed: } ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||||||||||||||
| 577 | d->m_validator = v; | - | ||||||||||||||||||||||||||||||||||||
| 578 | - | |||||||||||||||||||||||||||||||||||||
| 579 | if (d->m_validator
| 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
| 4-32 | ||||||||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||||||||
| 582 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 583 | , | - | ||||||||||||||||||||||||||||||||||||
| 584 | - | |||||||||||||||||||||||||||||||||||||
| 585 | 1057 | - | ||||||||||||||||||||||||||||||||||||
| 586 | )); signalIdx = QValidator::staticMetaObject.indexOfSignal(signal+1); } executed 4 times by 2 tests: if (methodIdx < 0end of blockExecuted by:
| 4-32 | ||||||||||||||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||||||||||||||
| 588 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 589 | , | - | ||||||||||||||||||||||||||||||||||||
| 590 | - | |||||||||||||||||||||||||||||||||||||
| 591 | 1057 | - | ||||||||||||||||||||||||||||||||||||
| 592 | )); if (code == 1
executed 4 times by 2 tests: else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);Executed by:
never executed: } ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+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 blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 602 | - | |||||||||||||||||||||||||||||||||||||
| 603 | if (isComponentComplete()
| 4-32 | ||||||||||||||||||||||||||||||||||||
| 604 | d->checkIsValid(); executed 4 times by 1 test: d->checkIsValid();Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||||||||||||||
| 606 | validatorChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||||||||||||||
| 608 | } executed 36 times by 2 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||||||||||||||
| 611 | void QQuickTextInput::q_validatorChanged() | - | ||||||||||||||||||||||||||||||||||||
| 612 | { | - | ||||||||||||||||||||||||||||||||||||
| 613 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 614 | d->checkIsValid(); | - | ||||||||||||||||||||||||||||||||||||
| 615 | } executed 70 times by 2 tests: end of blockExecuted by:
| 70 | ||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||||||||||||||
| 618 | QRectF 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
| 0 | ||||||||||||||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||||||||||||||
| 630 | a = m_cursor; never executed: a = m_cursor; | 0 | ||||||||||||||||||||||||||||||||||||
| 631 | else | - | ||||||||||||||||||||||||||||||||||||
| 632 | a = m_selstart == m_cursor
never executed: a = m_selstart == m_cursor ? m_selend : m_selstart; | 0 | ||||||||||||||||||||||||||||||||||||
| 633 | if (a >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||||||||||||||
| 635 | a += m_preeditCursor; | - | ||||||||||||||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||||||||||||||
| 637 | if (m_echoMode == QQuickTextInput::NoEcho
| 0 | ||||||||||||||||||||||||||||||||||||
| 638 | a = 0; never executed: a = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 639 | QTextLine l = m_textLayout.lineForTextPosition(a); | - | ||||||||||||||||||||||||||||||||||||
| 640 | if (l.isValid()
| 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: rect;return rect;never executed: return rect; | 0 | ||||||||||||||||||||||||||||||||||||
| 647 | } | - | ||||||||||||||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||||||||||||||
| 649 | void QQuickTextInputPrivate::checkIsValid() | - | ||||||||||||||||||||||||||||||||||||
| 650 | { | - | ||||||||||||||||||||||||||||||||||||
| 651 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||||||||||||||
| 653 | ValidatorState state = hasAcceptableInput(m_text); | - | ||||||||||||||||||||||||||||||||||||
| 654 | if (!m_maskData
| 848-1302 | ||||||||||||||||||||||||||||||||||||
| 655 | m_validInput = state != InvalidInput; executed 848 times by 5 tests: m_validInput = state != InvalidInput;Executed by:
| 848 | ||||||||||||||||||||||||||||||||||||
| 656 | if (state != AcceptableInput
| 700-1450 | ||||||||||||||||||||||||||||||||||||
| 657 | if (m_acceptableInput
| 180-520 | ||||||||||||||||||||||||||||||||||||
| 658 | m_acceptableInput = false; | - | ||||||||||||||||||||||||||||||||||||
| 659 | q->acceptableInputChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 660 | } executed 520 times by 2 tests: end of blockExecuted by:
| 520 | ||||||||||||||||||||||||||||||||||||
| 661 | } executed 700 times by 2 tests: else if (!m_acceptableInputend of blockExecuted by:
| 14-1436 | ||||||||||||||||||||||||||||||||||||
| 662 | m_acceptableInput = true; | - | ||||||||||||||||||||||||||||||||||||
| 663 | q->acceptableInputChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 664 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 665 | } executed 2150 times by 5 tests: end of blockExecuted by:
| 2150 | ||||||||||||||||||||||||||||||||||||
| 666 | QString QQuickTextInput::inputMask() const | - | ||||||||||||||||||||||||||||||||||||
| 667 | { | - | ||||||||||||||||||||||||||||||||||||
| 668 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 669 | return executed 22 times by 1 test: d->inputMask();return d->inputMask();Executed by:
executed 22 times by 1 test: return d->inputMask();Executed by:
| 22 | ||||||||||||||||||||||||||||||||||||
| 670 | } | - | ||||||||||||||||||||||||||||||||||||
| 671 | - | |||||||||||||||||||||||||||||||||||||
| 672 | void QQuickTextInput::setInputMask(const QString &im) | - | ||||||||||||||||||||||||||||||||||||
| 673 | { | - | ||||||||||||||||||||||||||||||||||||
| 674 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 675 | if (d->inputMask() == im
| 88-256 | ||||||||||||||||||||||||||||||||||||
| 676 | return; executed 88 times by 1 test: return;Executed by:
| 88 | ||||||||||||||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||||||||||||||
| 678 | d->setInputMask(im); | - | ||||||||||||||||||||||||||||||||||||
| 679 | inputMaskChanged(d->inputMask()); | - | ||||||||||||||||||||||||||||||||||||
| 680 | } executed 256 times by 1 test: end of blockExecuted by:
| 256 | ||||||||||||||||||||||||||||||||||||
| 681 | bool QQuickTextInput::hasAcceptableInput() const | - | ||||||||||||||||||||||||||||||||||||
| 682 | { | - | ||||||||||||||||||||||||||||||||||||
| 683 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 684 | return executed 230 times by 1 test: d->m_acceptableInput;return d->m_acceptableInput;Executed by:
executed 230 times by 1 test: return d->m_acceptableInput;Executed by:
| 230 | ||||||||||||||||||||||||||||||||||||
| 685 | } | - | ||||||||||||||||||||||||||||||||||||
| 686 | Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const | - | ||||||||||||||||||||||||||||||||||||
| 687 | { | - | ||||||||||||||||||||||||||||||||||||
| 688 | Qt::InputMethodHints hints = inputMethodHints; | - | ||||||||||||||||||||||||||||||||||||
| 689 | if (m_echoMode == QQuickTextInput::Password
| 2-384 | ||||||||||||||||||||||||||||||||||||
| 690 | hints |= Qt::ImhHiddenText; executed 14 times by 1 test: hints |= Qt::ImhHiddenText;Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 691 | else if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
| 4-378 | ||||||||||||||||||||||||||||||||||||
| 692 | hints &= ~Qt::ImhHiddenText; executed 4 times by 1 test: hints &= ~Qt::ImhHiddenText;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 693 | if (m_echoMode != QQuickTextInput::Normal
| 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:
| 18 | ||||||||||||||||||||||||||||||||||||
| 695 | return executed 396 times by 3 tests: hints;return hints;Executed by:
executed 396 times by 3 tests: return hints;Executed by:
| 396 | ||||||||||||||||||||||||||||||||||||
| 696 | } | - | ||||||||||||||||||||||||||||||||||||
| 697 | QQuickTextInput::EchoMode QQuickTextInput::echoMode() const | - | ||||||||||||||||||||||||||||||||||||
| 698 | { | - | ||||||||||||||||||||||||||||||||||||
| 699 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 700 | return executed 112 times by 1 test: QQuickTextInput::EchoMode(d->m_echoMode);return QQuickTextInput::EchoMode(d->m_echoMode);Executed by:
executed 112 times by 1 test: return QQuickTextInput::EchoMode(d->m_echoMode);Executed by:
| 112 | ||||||||||||||||||||||||||||||||||||
| 701 | } | - | ||||||||||||||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||||||||||||||
| 703 | void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo) | - | ||||||||||||||||||||||||||||||||||||
| 704 | { | - | ||||||||||||||||||||||||||||||||||||
| 705 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 706 | if (echoMode() == echo
| 28-54 | ||||||||||||||||||||||||||||||||||||
| 707 | return; executed 54 times by 1 test: return;Executed by:
| 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 blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 719 | Qt::InputMethodHints QQuickTextInput::inputMethodHints() const | - | ||||||||||||||||||||||||||||||||||||
| 720 | { | - | ||||||||||||||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||||||||||||||
| 723 | - | |||||||||||||||||||||||||||||||||||||
| 724 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 725 | return executed 14 times by 1 test: d->inputMethodHints;return d->inputMethodHints;Executed by:
executed 14 times by 1 test: return d->inputMethodHints;Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||||||||||||||
| 727 | } | - | ||||||||||||||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||||||||||||||
| 729 | void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints) | - | ||||||||||||||||||||||||||||||||||||
| 730 | { | - | ||||||||||||||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||||||||||||||
| 734 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 735 | - | |||||||||||||||||||||||||||||||||||||
| 736 | if (hints == d->inputMethodHints
| 4 | ||||||||||||||||||||||||||||||||||||
| 737 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 738 | - | |||||||||||||||||||||||||||||||||||||
| 739 | d->inputMethodHints = hints; | - | ||||||||||||||||||||||||||||||||||||
| 740 | updateInputMethod(Qt::ImHints); | - | ||||||||||||||||||||||||||||||||||||
| 741 | inputMethodHintsChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 742 | - | |||||||||||||||||||||||||||||||||||||
| 743 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 744 | QQmlComponent* QQuickTextInput::cursorDelegate() const | - | ||||||||||||||||||||||||||||||||||||
| 745 | { | - | ||||||||||||||||||||||||||||||||||||
| 746 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 747 | return never executed: d->cursorComponent;return d->cursorComponent;never executed: return d->cursorComponent; | 0 | ||||||||||||||||||||||||||||||||||||
| 748 | } | - | ||||||||||||||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||||||||||||||
| 750 | void 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 blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||||||||||||||
| 756 | void 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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 762 | QRectF QQuickTextInput::positionToRectangle(int pos) const | - | ||||||||||||||||||||||||||||||||||||
| 763 | { | - | ||||||||||||||||||||||||||||||||||||
| 764 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 765 | if (d->m_echoMode == NoEcho
| 0-420 | ||||||||||||||||||||||||||||||||||||
| 766 | pos = 0; never executed: pos = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 767 | - | |||||||||||||||||||||||||||||||||||||
| 768 | else if (pos > d->m_cursor
| 26-394 | ||||||||||||||||||||||||||||||||||||
| 769 | pos += d->preeditAreaText().length(); executed 26 times by 1 test: pos += d->preeditAreaText().length();Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||||||||
| 771 | QTextLine l = d->m_textLayout.lineForTextPosition(pos); | - | ||||||||||||||||||||||||||||||||||||
| 772 | if (!l.isValid()
| 0-420 | ||||||||||||||||||||||||||||||||||||
| 773 | return never executed: QRectF();return 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
| 0-420 | ||||||||||||||||||||||||||||||||||||
| 778 | if (pos < text().length()
| 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: QRectF(x, y, w, l.height());return QRectF(x, y, w, l.height());Executed by:
executed 420 times by 1 test: return QRectF(x, y, w, l.height());Executed by:
| 420 | ||||||||||||||||||||||||||||||||||||
| 784 | } | - | ||||||||||||||||||||||||||||||||||||
| 785 | void 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
| 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 (++
| 16-22 | ||||||||||||||||||||||||||||||||||||
| 802 | arg = (*args)[i]; | - | ||||||||||||||||||||||||||||||||||||
| 803 | y = arg->toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 804 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||||||||||||||
| 806 | if (++
| 8-30 | ||||||||||||||||||||||||||||||||||||
| 807 | arg = (*args)[i]; | - | ||||||||||||||||||||||||||||||||||||
| 808 | position = QTextLine::CursorPosition(arg->toInt32()); | - | ||||||||||||||||||||||||||||||||||||
| 809 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 810 | - | |||||||||||||||||||||||||||||||||||||
| 811 | int pos = d->positionAt(x, y, position); | - | ||||||||||||||||||||||||||||||||||||
| 812 | const int cursor = d->m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 813 | if (pos > cursor
| 14-24 | ||||||||||||||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||||||||||||||
| 815 | const int preeditLength = d->preeditAreaText().length(); | - | ||||||||||||||||||||||||||||||||||||
| 816 | pos = pos > cursor + preeditLength
| 4-10 | ||||||||||||||||||||||||||||||||||||
| 817 | ? pos - preeditLength | - | ||||||||||||||||||||||||||||||||||||
| 818 | : cursor; | - | ||||||||||||||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||||||||
| 821 | - | |||||||||||||||||||||||||||||||||||||
| 822 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 823 | args->setReturnValue(QV4::Encode(pos)); | - | ||||||||||||||||||||||||||||||||||||
| 824 | } executed 38 times by 1 test: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||||||||||||||
| 826 | int 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()
| 12-150 | ||||||||||||||||||||||||||||||||||||
| 833 | QTextLine nextLine = m_textLayout.lineAt(i); | - | ||||||||||||||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||||||||||||||
| 835 | if (y < (line.rect().bottom() + nextLine.y()) / 2
| 4-8 | ||||||||||||||||||||||||||||||||||||
| 836 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 837 | line = nextLine; | - | ||||||||||||||||||||||||||||||||||||
| 838 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 839 | return executed 158 times by 1 test: line.isValid() ? line.xToCursor(x, position) : 0;return line.isValid() ? line.xToCursor(x, position) : 0;Executed by:
executed 158 times by 1 test: return line.isValid() ? line.xToCursor(x, position) : 0;Executed by:
| 158 | ||||||||||||||||||||||||||||||||||||
| 840 | } | - | ||||||||||||||||||||||||||||||||||||
| 841 | bool QQuickTextInput::overwriteMode() const | - | ||||||||||||||||||||||||||||||||||||
| 842 | { | - | ||||||||||||||||||||||||||||||||||||
| 843 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 844 | return executed 6 times by 1 test: d->overwriteMode;return d->overwriteMode;Executed by:
executed 6 times by 1 test: return d->overwriteMode;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 845 | } | - | ||||||||||||||||||||||||||||||||||||
| 846 | - | |||||||||||||||||||||||||||||||||||||
| 847 | void QQuickTextInput::setOverwriteMode(bool overwrite) | - | ||||||||||||||||||||||||||||||||||||
| 848 | { | - | ||||||||||||||||||||||||||||||||||||
| 849 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 850 | if (d->overwriteMode == overwrite
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 851 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 852 | d->overwriteMode = overwrite; | - | ||||||||||||||||||||||||||||||||||||
| 853 | overwriteModeChanged(overwrite); | - | ||||||||||||||||||||||||||||||||||||
| 854 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||||||||||||||
| 856 | void QQuickTextInput::keyPressEvent(QKeyEvent* ev) | - | ||||||||||||||||||||||||||||||||||||
| 857 | { | - | ||||||||||||||||||||||||||||||||||||
| 858 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||||||||||||||
| 860 | bool ignore = (ev->key() == Qt::Key_Up
| 0-1988 | ||||||||||||||||||||||||||||||||||||
| 861 | if (!ignore
| 2-1988 | ||||||||||||||||||||||||||||||||||||
| 862 | - | |||||||||||||||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||||||||||||||
| 864 | int cursorPosition = d->m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 865 | if (cursorPosition == 0
| 16-70 | ||||||||||||||||||||||||||||||||||||
| 866 | ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight
executed 16 times by 1 test: ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);Executed by:
| 2-16 | ||||||||||||||||||||||||||||||||||||
| 867 | if (!ignore
| 6-80 | ||||||||||||||||||||||||||||||||||||
| 868 | ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight
executed 14 times by 1 test: ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);Executed by:
| 2-14 | ||||||||||||||||||||||||||||||||||||
| 869 | } executed 86 times by 1 test: end of blockExecuted by:
| 86 | ||||||||||||||||||||||||||||||||||||
| 870 | if (ignore
| 14-1976 | ||||||||||||||||||||||||||||||||||||
| 871 | ev->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 872 | } executed 14 times by 1 test: else {end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 873 | d->processKeyEvent(ev); | - | ||||||||||||||||||||||||||||||||||||
| 874 | } executed 1976 times by 2 tests: end of blockExecuted by:
| 1976 | ||||||||||||||||||||||||||||||||||||
| 875 | if (!ev->isAccepted()
| 226-1764 | ||||||||||||||||||||||||||||||||||||
| 876 | QQuickImplicitSizeItem::keyPressEvent(ev); executed 226 times by 2 tests: QQuickImplicitSizeItem::keyPressEvent(ev);Executed by:
| 226 | ||||||||||||||||||||||||||||||||||||
| 877 | } executed 1990 times by 2 tests: end of blockExecuted by:
| 1990 | ||||||||||||||||||||||||||||||||||||
| 878 | - | |||||||||||||||||||||||||||||||||||||
| 879 | - | |||||||||||||||||||||||||||||||||||||
| 880 | void QQuickTextInput::inputMethodEvent(QInputMethodEvent *ev) | - | ||||||||||||||||||||||||||||||||||||
| 881 | { | - | ||||||||||||||||||||||||||||||||||||
| 882 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 883 | const bool wasComposing = d->hasImState; | - | ||||||||||||||||||||||||||||||||||||
| 884 | if (d->m_readOnly
| 0-348 | ||||||||||||||||||||||||||||||||||||
| 885 | ev->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 886 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 887 | d->processInputMethodEvent(ev); | - | ||||||||||||||||||||||||||||||||||||
| 888 | } executed 348 times by 1 test: end of blockExecuted by:
| 348 | ||||||||||||||||||||||||||||||||||||
| 889 | if (!ev->isAccepted()
| 0-348 | ||||||||||||||||||||||||||||||||||||
| 890 | QQuickImplicitSizeItem::inputMethodEvent(ev); never executed: QQuickImplicitSizeItem::inputMethodEvent(ev); | 0 | ||||||||||||||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||||||||||||||
| 892 | if (wasComposing != d->hasImState
| 44-304 | ||||||||||||||||||||||||||||||||||||
| 893 | inputMethodComposingChanged(); executed 44 times by 1 test: inputMethodComposingChanged();Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||
| 894 | } executed 348 times by 1 test: end of blockExecuted by:
| 348 | ||||||||||||||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||||||||||||||
| 897 | void QQuickTextInput::mouseDoubleClickEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 898 | { | - | ||||||||||||||||||||||||||||||||||||
| 899 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 900 | - | |||||||||||||||||||||||||||||||||||||
| 901 | if (d->selectByMouse
| 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()
| 2-4 | ||||||||||||||||||||||||||||||||||||
| 909 | d->tripleClickStartPoint = event->localPos(); | - | ||||||||||||||||||||||||||||||||||||
| 910 | d->tripleClickTimer.start(); | - | ||||||||||||||||||||||||||||||||||||
| 911 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 912 | } executed 6 times by 1 test: else {end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 913 | if (d->sendMouseEventToInputContext(event)
| 0 | ||||||||||||||||||||||||||||||||||||
| 914 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 915 | QQuickImplicitSizeItem::mouseDoubleClickEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 916 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 917 | } | - | ||||||||||||||||||||||||||||||||||||
| 918 | - | |||||||||||||||||||||||||||||||||||||
| 919 | void QQuickTextInput::mousePressEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 920 | { | - | ||||||||||||||||||||||||||||||||||||
| 921 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||||||||||||||
| 923 | d->pressPos = event->localPos(); | - | ||||||||||||||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||||||||||||||
| 925 | if (d->sendMouseEventToInputContext(event)
| 2-84 | ||||||||||||||||||||||||||||||||||||
| 926 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||||||||||||||
| 928 | if (d->selectByMouse
| 16-68 | ||||||||||||||||||||||||||||||||||||
| 929 | setKeepMouseGrab(false); | - | ||||||||||||||||||||||||||||||||||||
| 930 | d->selectPressed = true; | - | ||||||||||||||||||||||||||||||||||||
| 931 | QPointF distanceVector = d->pressPos - d->tripleClickStartPoint; | - | ||||||||||||||||||||||||||||||||||||
| 932 | if (d->hasPendingTripleClick()
| 12-56 | ||||||||||||||||||||||||||||||||||||
| 933 | && distanceVector.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()
| 2-10 | ||||||||||||||||||||||||||||||||||||
| 934 | event->setAccepted(true); | - | ||||||||||||||||||||||||||||||||||||
| 935 | selectAll(); | - | ||||||||||||||||||||||||||||||||||||
| 936 | return; executed 10 times by 1 test: return;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 937 | } | - | ||||||||||||||||||||||||||||||||||||
| 938 | } executed 58 times by 1 test: end of blockExecuted by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||||||||||||||
| 940 | bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse
| 0 | ||||||||||||||||||||||||||||||||||||
| 941 | int cursor = d->positionAt(event->localPos()); | - | ||||||||||||||||||||||||||||||||||||
| 942 | d->moveCursor(cursor, mark); | - | ||||||||||||||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||||||||||||||
| 944 | if (d->focusOnPress
| 0-64 | ||||||||||||||||||||||||||||||||||||
| 945 | ensureActiveFocus(); executed 64 times by 1 test: ensureActiveFocus();Executed by:
| 64 | ||||||||||||||||||||||||||||||||||||
| 946 | - | |||||||||||||||||||||||||||||||||||||
| 947 | event->setAccepted(true); | - | ||||||||||||||||||||||||||||||||||||
| 948 | } executed 74 times by 1 test: end of blockExecuted by:
| 74 | ||||||||||||||||||||||||||||||||||||
| 949 | - | |||||||||||||||||||||||||||||||||||||
| 950 | void QQuickTextInput::mouseMoveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 951 | { | - | ||||||||||||||||||||||||||||||||||||
| 952 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 953 | - | |||||||||||||||||||||||||||||||||||||
| 954 | if (d->selectPressed
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 955 | if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance()
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 956 | setKeepMouseGrab(true); executed 36 times by 1 test: setKeepMouseGrab(true);Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||||||||||||||
| 958 | - | |||||||||||||||||||||||||||||||||||||
| 959 | if (d->composeMode()
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 960 | - | |||||||||||||||||||||||||||||||||||||
| 961 | int startPos = d->positionAt(d->pressPos); | - | ||||||||||||||||||||||||||||||||||||
| 962 | int currentPos = d->positionAt(event->localPos()); | - | ||||||||||||||||||||||||||||||||||||
| 963 | if (startPos != currentPos
| 0 | ||||||||||||||||||||||||||||||||||||
| 964 | d->setSelection(startPos, currentPos - startPos); never executed: d->setSelection(startPos, currentPos - startPos); | 0 | ||||||||||||||||||||||||||||||||||||
| 965 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||||||||
| 967 | { | - | ||||||||||||||||||||||||||||||||||||
| 968 | moveCursorSelection(d->positionAt(event->localPos()), d->mouseSelectionMode); | - | ||||||||||||||||||||||||||||||||||||
| 969 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 970 | event->setAccepted(true); | - | ||||||||||||||||||||||||||||||||||||
| 971 | } executed 36 times by 1 test: else {end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 972 | QQuickImplicitSizeItem::mouseMoveEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 973 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 974 | } | - | ||||||||||||||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||||||||||||||
| 976 | void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 977 | { | - | ||||||||||||||||||||||||||||||||||||
| 978 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 979 | if (d->sendMouseEventToInputContext(event)
| 2-84 | ||||||||||||||||||||||||||||||||||||
| 980 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 981 | if (d->selectPressed
| 16-68 | ||||||||||||||||||||||||||||||||||||
| 982 | d->selectPressed = false; | - | ||||||||||||||||||||||||||||||||||||
| 983 | setKeepMouseGrab(false); | - | ||||||||||||||||||||||||||||||||||||
| 984 | } executed 68 times by 1 test: end of blockExecuted by:
| 68 | ||||||||||||||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||||||||||||||
| 986 | if (QGuiApplication::clipboard()->supportsSelection()
| 0-84 | ||||||||||||||||||||||||||||||||||||
| 987 | if (event->button() == Qt::LeftButton
| 2-82 | ||||||||||||||||||||||||||||||||||||
| 988 | d->copy(QClipboard::Selection); | - | ||||||||||||||||||||||||||||||||||||
| 989 | } executed 82 times by 1 test: else if (!d->m_readOnlyend of blockExecuted by:
| 0-82 | ||||||||||||||||||||||||||||||||||||
| 990 | d->deselect(); | - | ||||||||||||||||||||||||||||||||||||
| 991 | d->insert(QGuiApplication::clipboard()->text(QClipboard::Selection)); | - | ||||||||||||||||||||||||||||||||||||
| 992 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 993 | } executed 84 times by 1 test: end of blockExecuted by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 994 | - | |||||||||||||||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||||||||||||||
| 996 | if (d->focusOnPress
| 0-74 | ||||||||||||||||||||||||||||||||||||
| 997 | ensureActiveFocus(); never executed: ensureActiveFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||||||||||||||
| 999 | if (!event->isAccepted()
| 0-84 | ||||||||||||||||||||||||||||||||||||
| 1000 | QQuickImplicitSizeItem::mouseReleaseEvent(event); never executed: QQuickImplicitSizeItem::mouseReleaseEvent(event); | 0 | ||||||||||||||||||||||||||||||||||||
| 1001 | } executed 84 times by 1 test: end of blockExecuted by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 1002 | - | |||||||||||||||||||||||||||||||||||||
| 1003 | bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 1004 | { | - | ||||||||||||||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||||||||||||||
| 1006 | if (composeMode()
| 4-168 | ||||||||||||||||||||||||||||||||||||
| 1007 | int tmp_cursor = positionAt(event->localPos()); | - | ||||||||||||||||||||||||||||||||||||
| 1008 | int mousePos = tmp_cursor - m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 1009 | if (mousePos >= 0
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 1010 | if (event->type() == QEvent::MouseButtonRelease
| 2 | ||||||||||||||||||||||||||||||||||||
| 1011 | QGuiApplication::inputMethod()->invokeAction(QInputMethod::Click, mousePos); | - | ||||||||||||||||||||||||||||||||||||
| 1012 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1013 | return executed 4 times by 1 test: true;return true;Executed by:
executed 4 times by 1 test: return true;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1014 | } | - | ||||||||||||||||||||||||||||||||||||
| 1015 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||||||||||||||
| 1020 | return executed 168 times by 1 test: false;return false;Executed by:
executed 168 times by 1 test: return false;Executed by:
| 168 | ||||||||||||||||||||||||||||||||||||
| 1021 | } | - | ||||||||||||||||||||||||||||||||||||
| 1022 | - | |||||||||||||||||||||||||||||||||||||
| 1023 | void 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 blockExecuted by:
| 86 | ||||||||||||||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||||||||||||||
| 1030 | bool QQuickTextInput::event(QEvent* ev) | - | ||||||||||||||||||||||||||||||||||||
| 1031 | { | - | ||||||||||||||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||||||||||||||
| 1033 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1034 | if (ev->type() == QEvent::ShortcutOverride
| 1176-7113 | ||||||||||||||||||||||||||||||||||||
| 1035 | if (d->m_readOnly
| 0-1176 | ||||||||||||||||||||||||||||||||||||
| 1036 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 1037 | QKeyEvent* ke = static_cast<QKeyEvent*>(ev); | - | ||||||||||||||||||||||||||||||||||||
| 1038 | if (ke == QKeySequence::Copy
| 10-1166 | ||||||||||||||||||||||||||||||||||||
| 1039 | || ke == QKeySequence::Paste
| 4-1162 | ||||||||||||||||||||||||||||||||||||
| 1040 | || ke == QKeySequence::Cut
| 2-1160 | ||||||||||||||||||||||||||||||||||||
| 1041 | || ke == QKeySequence::Redo
| 0-1160 | ||||||||||||||||||||||||||||||||||||
| 1042 | || ke == QKeySequence::Undo
| 0-1160 | ||||||||||||||||||||||||||||||||||||
| 1043 | || ke == QKeySequence::MoveToNextWord
| 8-1152 | ||||||||||||||||||||||||||||||||||||
| 1044 | || ke == QKeySequence::MoveToPreviousWord
| 8-1144 | ||||||||||||||||||||||||||||||||||||
| 1045 | || ke == QKeySequence::MoveToStartOfDocument
| 0-1144 | ||||||||||||||||||||||||||||||||||||
| 1046 | || ke == QKeySequence::MoveToEndOfDocument
| 0-1144 | ||||||||||||||||||||||||||||||||||||
| 1047 | || ke == QKeySequence::SelectNextWord
| 2-1142 | ||||||||||||||||||||||||||||||||||||
| 1048 | || ke == QKeySequence::SelectPreviousWord
| 2-1140 | ||||||||||||||||||||||||||||||||||||
| 1049 | || ke == QKeySequence::SelectStartOfLine
| 2-1138 | ||||||||||||||||||||||||||||||||||||
| 1050 | || ke == QKeySequence::SelectEndOfLine
| 2-1136 | ||||||||||||||||||||||||||||||||||||
| 1051 | || ke == QKeySequence::SelectStartOfBlock
| 0-1136 | ||||||||||||||||||||||||||||||||||||
| 1052 | || ke == QKeySequence::SelectEndOfBlock
| 0-1136 | ||||||||||||||||||||||||||||||||||||
| 1053 | || ke == QKeySequence::SelectStartOfDocument
| 0-1136 | ||||||||||||||||||||||||||||||||||||
| 1054 | || ke == QKeySequence::SelectAll
| 4-1132 | ||||||||||||||||||||||||||||||||||||
| 1055 | || ke == QKeySequence::SelectEndOfDocument
| 2-1130 | ||||||||||||||||||||||||||||||||||||
| 1056 | || ke == QKeySequence::DeleteCompleteLine
| 2-1128 | ||||||||||||||||||||||||||||||||||||
| 1057 | ke->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 1058 | return executed 48 times by 1 test: true;return true;Executed by:
executed 48 times by 1 test: return true;Executed by:
| 48 | ||||||||||||||||||||||||||||||||||||
| 1059 | } else if (ke->modifiers() == Qt::NoModifier
| 26-1046 | ||||||||||||||||||||||||||||||||||||
| 1060 | || ke->modifiers() == Qt::KeypadModifier
| 0-56 | ||||||||||||||||||||||||||||||||||||
| 1061 | if (ke->key() < Qt::Key_Escape
| 96-976 | ||||||||||||||||||||||||||||||||||||
| 1062 | ke->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 1063 | return executed 976 times by 1 test: true;return true;Executed by:
executed 976 times by 1 test: return true;Executed by:
| 976 | ||||||||||||||||||||||||||||||||||||
| 1064 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 1065 | switch (ke->key()) { | - | ||||||||||||||||||||||||||||||||||||
| 1066 | case executed 14 times by 1 test: Qt::Key_Delete:case Qt::Key_Delete:Executed by:
executed 14 times by 1 test: case Qt::Key_Delete:Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 1067 | case executed 2 times by 1 test: Qt::Key_Home:case Qt::Key_Home:Executed by:
executed 2 times by 1 test: case Qt::Key_Home:Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1068 | case never executed: Qt::Key_End:case Qt::Key_End:never executed: case Qt::Key_End: | 0 | ||||||||||||||||||||||||||||||||||||
| 1069 | case executed 36 times by 1 test: Qt::Key_Backspace:case Qt::Key_Backspace:Executed by:
executed 36 times by 1 test: case Qt::Key_Backspace:Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1070 | case executed 10 times by 1 test: Qt::Key_Left:case Qt::Key_Left:Executed by:
executed 10 times by 1 test: case Qt::Key_Left:Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1071 | case executed 6 times by 1 test: Qt::Key_Right:case Qt::Key_Right:Executed by:
executed 6 times by 1 test: case Qt::Key_Right:Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1072 | ke->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 1073 | return executed 68 times by 1 test: true;return true;Executed by:
executed 68 times by 1 test: return true;Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||
| 1074 | default executed 28 times by 1 test: :default:Executed by:
executed 28 times by 1 test: default:Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1075 | break; executed 28 times by 1 test: break;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1076 | } | - | ||||||||||||||||||||||||||||||||||||
| 1077 | } | - | ||||||||||||||||||||||||||||||||||||
| 1078 | } | - | ||||||||||||||||||||||||||||||||||||
| 1079 | } executed 84 times by 1 test: end of blockExecuted by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||||||||||||||
| 1082 | return executed 7197 times by 5 tests: QQuickImplicitSizeItem::event(ev);return QQuickImplicitSizeItem::event(ev);Executed by:
executed 7197 times by 5 tests: return QQuickImplicitSizeItem::event(ev);Executed by:
| 7197 | ||||||||||||||||||||||||||||||||||||
| 1083 | } | - | ||||||||||||||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||||||||||||||
| 1085 | void QQuickTextInput::geometryChanged(const QRectF &newGeometry, | - | ||||||||||||||||||||||||||||||||||||
| 1086 | const QRectF &oldGeometry) | - | ||||||||||||||||||||||||||||||||||||
| 1087 | { | - | ||||||||||||||||||||||||||||||||||||
| 1088 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1089 | if (!d->inLayout
| 6-3019 | ||||||||||||||||||||||||||||||||||||
| 1090 | if (newGeometry.width() != oldGeometry.width()
| 333-2686 | ||||||||||||||||||||||||||||||||||||
| 1091 | d->updateLayout(); executed 2686 times by 5 tests: d->updateLayout();Executed by:
| 2686 | ||||||||||||||||||||||||||||||||||||
| 1092 | else if (newGeometry.height() != oldGeometry.height()
| 20-282 | ||||||||||||||||||||||||||||||||||||
| 1093 | d->updateBaselineOffset(); executed 20 times by 1 test: d->updateBaselineOffset();Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 1094 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 1095 | } executed 3019 times by 5 tests: end of blockExecuted by:
| 3019 | ||||||||||||||||||||||||||||||||||||
| 1096 | QQuickImplicitSizeItem::geometryChanged(newGeometry, oldGeometry); | - | ||||||||||||||||||||||||||||||||||||
| 1097 | } executed 3025 times by 5 tests: end of blockExecuted by:
| 3025 | ||||||||||||||||||||||||||||||||||||
| 1098 | - | |||||||||||||||||||||||||||||||||||||
| 1099 | void 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()
| 10-8395 | ||||||||||||||||||||||||||||||||||||
| 1107 | cix = textLine.cursorToX(position + preeditLength); | - | ||||||||||||||||||||||||||||||||||||
| 1108 | const qreal cursorWidth = cix >= 0
| 64-8331 | ||||||||||||||||||||||||||||||||||||
| 1109 | widthUsed = qMax(textLine.naturalTextWidth(), cursorWidth); | - | ||||||||||||||||||||||||||||||||||||
| 1110 | } executed 8395 times by 5 tests: end of blockExecuted by:
| 8395 | ||||||||||||||||||||||||||||||||||||
| 1111 | int previousScroll = hscroll; | - | ||||||||||||||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||||||||||||||
| 1113 | if (widthUsed <= width
| 314-8091 | ||||||||||||||||||||||||||||||||||||
| 1114 | hscroll = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1115 | } executed 8091 times by 5 tests: else {end of blockExecuted by:
| 8091 | ||||||||||||||||||||||||||||||||||||
| 1116 | ((textLine.isValid()) ? static_cast<void>(0) : qt_assert("textLine.isValid()", __FILE__, 1754)); | - | ||||||||||||||||||||||||||||||||||||
| 1117 | if (cix - hscroll >= width
| 138-176 | ||||||||||||||||||||||||||||||||||||
| 1118 | - | |||||||||||||||||||||||||||||||||||||
| 1119 | hscroll = cix - width; | - | ||||||||||||||||||||||||||||||||||||
| 1120 | } executed 138 times by 2 tests: else if (cix - hscroll < 0end of blockExecuted by:
| 2-138 | ||||||||||||||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||||||||||||||
| 1122 | hscroll = cix; | - | ||||||||||||||||||||||||||||||||||||
| 1123 | } executed 70 times by 2 tests: else if (widthUsed - hscroll < widthend of blockExecuted by:
| 10-96 | ||||||||||||||||||||||||||||||||||||
| 1124 | - | |||||||||||||||||||||||||||||||||||||
| 1125 | - | |||||||||||||||||||||||||||||||||||||
| 1126 | hscroll = widthUsed - width; | - | ||||||||||||||||||||||||||||||||||||
| 1127 | } executed 10 times by 1 test: else if (width - hscroll > widthUsedend of blockExecuted by:
| 8-88 | ||||||||||||||||||||||||||||||||||||
| 1128 | - | |||||||||||||||||||||||||||||||||||||
| 1129 | - | |||||||||||||||||||||||||||||||||||||
| 1130 | hscroll = width - widthUsed; | - | ||||||||||||||||||||||||||||||||||||
| 1131 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1132 | - | |||||||||||||||||||||||||||||||||||||
| 1133 | if (preeditLength > 0
| 26-288 | ||||||||||||||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||||||||||||||
| 1136 | cix = textLine.cursorToX(position + qMax(0, preeditCursor - 1)); | - | ||||||||||||||||||||||||||||||||||||
| 1137 | if (cix < hscroll
| 10-16 | ||||||||||||||||||||||||||||||||||||
| 1138 | hscroll = cix; executed 10 times by 1 test: hscroll = cix;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1139 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 1140 | - | |||||||||||||||||||||||||||||||||||||
| 1141 | } executed 314 times by 2 tests: end of blockExecuted by:
| 314 | ||||||||||||||||||||||||||||||||||||
| 1142 | if (previousScroll != hscroll
| 208-8197 | ||||||||||||||||||||||||||||||||||||
| 1143 | textLayoutDirty = true; executed 208 times by 2 tests: textLayoutDirty = true;Executed by:
| 208 | ||||||||||||||||||||||||||||||||||||
| 1144 | } executed 8405 times by 5 tests: end of blockExecuted by:
| 8405 | ||||||||||||||||||||||||||||||||||||
| 1145 | - | |||||||||||||||||||||||||||||||||||||
| 1146 | void QQuickTextInputPrivate::updateHorizontalScroll() | - | ||||||||||||||||||||||||||||||||||||
| 1147 | { | - | ||||||||||||||||||||||||||||||||||||
| 1148 | if (autoScroll
| 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: else {end of blockExecuted by:
| 8401 | ||||||||||||||||||||||||||||||||||||
| 1156 | hscroll = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1157 | } executed 132 times by 1 test: end of blockExecuted by:
| 132 | ||||||||||||||||||||||||||||||||||||
| 1158 | } | - | ||||||||||||||||||||||||||||||||||||
| 1159 | - | |||||||||||||||||||||||||||||||||||||
| 1160 | void 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
| 122-8411 | ||||||||||||||||||||||||||||||||||||
| 1171 | - | |||||||||||||||||||||||||||||||||||||
| 1172 | vscroll = -QQuickTextUtil::alignedY( | - | ||||||||||||||||||||||||||||||||||||
| 1173 | heightUsed, height, vAlign & ~(Qt::AlignAbsolute|Qt::AlignHorizontal_Mask)); | - | ||||||||||||||||||||||||||||||||||||
| 1174 | } executed 8275 times by 5 tests: else {end of blockExecuted by:
| 8275 | ||||||||||||||||||||||||||||||||||||
| 1175 | - | |||||||||||||||||||||||||||||||||||||
| 1176 | QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor + preeditLength); | - | ||||||||||||||||||||||||||||||||||||
| 1177 | - | |||||||||||||||||||||||||||||||||||||
| 1178 | - | |||||||||||||||||||||||||||||||||||||
| 1179 | - | |||||||||||||||||||||||||||||||||||||
| 1180 | QRectF r = currentLine.isValid()
| 0-258 | ||||||||||||||||||||||||||||||||||||
| 1181 | qreal top = r.top(); | - | ||||||||||||||||||||||||||||||||||||
| 1182 | int bottom = r.bottom(); | - | ||||||||||||||||||||||||||||||||||||
| 1183 | - | |||||||||||||||||||||||||||||||||||||
| 1184 | if (bottom - vscroll >= height
| 96-162 | ||||||||||||||||||||||||||||||||||||
| 1185 | - | |||||||||||||||||||||||||||||||||||||
| 1186 | vscroll = bottom - height; | - | ||||||||||||||||||||||||||||||||||||
| 1187 | } executed 162 times by 1 test: else if (top - vscroll < 0end of blockExecuted by:
| 0-162 | ||||||||||||||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||||||||||||||
| 1189 | vscroll = top; | - | ||||||||||||||||||||||||||||||||||||
| 1190 | } executed 16 times by 1 test: else if (heightUsed - vscroll < heightend of blockExecuted by:
| 6-74 | ||||||||||||||||||||||||||||||||||||
| 1191 | - | |||||||||||||||||||||||||||||||||||||
| 1192 | - | |||||||||||||||||||||||||||||||||||||
| 1193 | vscroll = heightUsed - height; | - | ||||||||||||||||||||||||||||||||||||
| 1194 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1195 | - | |||||||||||||||||||||||||||||||||||||
| 1196 | if (preeditLength > 0
| 0-258 | ||||||||||||||||||||||||||||||||||||
| 1197 | - | |||||||||||||||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||||||||||||||
| 1199 | currentLine = m_textLayout.lineForTextPosition(m_cursor + qMax(0, m_preeditCursor - 1)); | - | ||||||||||||||||||||||||||||||||||||
| 1200 | top = currentLine.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1201 | if (top < vscroll
| 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 blockExecuted by:
| 258 | ||||||||||||||||||||||||||||||||||||
| 1206 | if (previousScroll != vscroll
| 74-8459 | ||||||||||||||||||||||||||||||||||||
| 1207 | textLayoutDirty = true; executed 74 times by 1 test: textLayoutDirty = true;Executed by:
| 74 | ||||||||||||||||||||||||||||||||||||
| 1208 | } executed 8533 times by 5 tests: end of blockExecuted by:
| 8533 | ||||||||||||||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||||||||||||||
| 1210 | void QQuickTextInput::triggerPreprocess() | - | ||||||||||||||||||||||||||||||||||||
| 1211 | { | - | ||||||||||||||||||||||||||||||||||||
| 1212 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1213 | if (d->updateType == QQuickTextInputPrivate::UpdateNone
| 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 | - | |||||||||||||||||||||||||||||||||||||
| 1219 | void QQuickTextInput::updatePolish() | - | ||||||||||||||||||||||||||||||||||||
| 1220 | { | - | ||||||||||||||||||||||||||||||||||||
| 1221 | invalidateFontCaches(); | - | ||||||||||||||||||||||||||||||||||||
| 1222 | } executed 302 times by 4 tests: end of blockExecuted by:
| 302 | ||||||||||||||||||||||||||||||||||||
| 1223 | - | |||||||||||||||||||||||||||||||||||||
| 1224 | void QQuickTextInput::invalidateFontCaches() | - | ||||||||||||||||||||||||||||||||||||
| 1225 | { | - | ||||||||||||||||||||||||||||||||||||
| 1226 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||||||||||||||
| 1228 | if (d->m_textLayout.engine() != nullptr
| 0-599 | ||||||||||||||||||||||||||||||||||||
| 1229 | d->m_textLayout.engine()->resetFontEngineCache(); executed 599 times by 4 tests: d->m_textLayout.engine()->resetFontEngineCache();Executed by:
| 599 | ||||||||||||||||||||||||||||||||||||
| 1230 | } executed 599 times by 4 tests: end of blockExecuted by:
| 599 | ||||||||||||||||||||||||||||||||||||
| 1231 | - | |||||||||||||||||||||||||||||||||||||
| 1232 | void QQuickTextInput::ensureActiveFocus() | - | ||||||||||||||||||||||||||||||||||||
| 1233 | { | - | ||||||||||||||||||||||||||||||||||||
| 1234 | bool hadActiveFocus = hasActiveFocus(); | - | ||||||||||||||||||||||||||||||||||||
| 1235 | forceActiveFocus(); | - | ||||||||||||||||||||||||||||||||||||
| 1236 | - | |||||||||||||||||||||||||||||||||||||
| 1237 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1238 | - | |||||||||||||||||||||||||||||||||||||
| 1239 | if (hasActiveFocus()
| 2-62 | ||||||||||||||||||||||||||||||||||||
| 1240 | (static_cast< executed 36 times by 1 test: QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();(static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();Executed by:
executed 36 times by 1 test: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1241 | - | |||||||||||||||||||||||||||||||||||||
| 1242 | - | |||||||||||||||||||||||||||||||||||||
| 1243 | - | |||||||||||||||||||||||||||||||||||||
| 1244 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||||||||||||||
| 1245 | - | |||||||||||||||||||||||||||||||||||||
| 1246 | QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) | - | ||||||||||||||||||||||||||||||||||||
| 1247 | { | - | ||||||||||||||||||||||||||||||||||||
| 1248 | (void)data;; | - | ||||||||||||||||||||||||||||||||||||
| 1249 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||||||||||||||
| 1251 | if (d->updateType != QQuickTextInputPrivate::UpdatePaintNode
| 0-297 | ||||||||||||||||||||||||||||||||||||
| 1252 | - | |||||||||||||||||||||||||||||||||||||
| 1253 | d->updateType = QQuickTextInputPrivate::UpdateNone; | - | ||||||||||||||||||||||||||||||||||||
| 1254 | return never executed: oldNode;return 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
| 135-162 | ||||||||||||||||||||||||||||||||||||
| 1261 | node = new QQuickTextNode(this); executed 162 times by 4 tests: node = new QQuickTextNode(this);Executed by:
| 162 | ||||||||||||||||||||||||||||||||||||
| 1262 | d->textNode = node; | - | ||||||||||||||||||||||||||||||||||||
| 1263 | - | |||||||||||||||||||||||||||||||||||||
| 1264 | const bool showCursor = !isReadOnly()
| 3-267 | ||||||||||||||||||||||||||||||||||||
| 1265 | - | |||||||||||||||||||||||||||||||||||||
| 1266 | if (!d->textLayoutDirty
| 0-211 | ||||||||||||||||||||||||||||||||||||
| 1267 | if (showCursor
| 26-60 | ||||||||||||||||||||||||||||||||||||
| 1268 | node->setCursor(cursorRectangle(), d->color); executed 26 times by 3 tests: node->setCursor(cursorRectangle(), d->color);Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 1269 | else | - | ||||||||||||||||||||||||||||||||||||
| 1270 | node->clearCursor(); executed 60 times by 2 tests: node->clearCursor();Executed by:
| 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
| 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: else {end of blockExecuted by:
| 209 | ||||||||||||||||||||||||||||||||||||
| 1282 | offset += -QPointF(d->hscroll, d->vscroll); | - | ||||||||||||||||||||||||||||||||||||
| 1283 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1284 | - | |||||||||||||||||||||||||||||||||||||
| 1285 | if (!d->m_textLayout.text().isEmpty()
| 66-145 | ||||||||||||||||||||||||||||||||||||
| 1286 | - | |||||||||||||||||||||||||||||||||||||
| 1287 | || !d->m_textLayout.preeditAreaText().isEmpty()
| 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 blockExecuted by:
| 147 | ||||||||||||||||||||||||||||||||||||
| 1297 | - | |||||||||||||||||||||||||||||||||||||
| 1298 | if (showCursor
| 40-171 | ||||||||||||||||||||||||||||||||||||
| 1299 | node->setCursor(cursorRectangle(), d->color); executed 40 times by 2 tests: node->setCursor(cursorRectangle(), d->color);Executed by:
| 40 | ||||||||||||||||||||||||||||||||||||
| 1300 | - | |||||||||||||||||||||||||||||||||||||
| 1301 | d->textLayoutDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 1302 | } executed 211 times by 4 tests: end of blockExecuted by:
| 211 | ||||||||||||||||||||||||||||||||||||
| 1303 | - | |||||||||||||||||||||||||||||||||||||
| 1304 | invalidateFontCaches(); | - | ||||||||||||||||||||||||||||||||||||
| 1305 | - | |||||||||||||||||||||||||||||||||||||
| 1306 | return executed 297 times by 4 tests: node;return node;Executed by:
executed 297 times by 4 tests: return node;Executed by:
| 297 | ||||||||||||||||||||||||||||||||||||
| 1307 | } | - | ||||||||||||||||||||||||||||||||||||
| 1308 | - | |||||||||||||||||||||||||||||||||||||
| 1309 | - | |||||||||||||||||||||||||||||||||||||
| 1310 | QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property) const | - | ||||||||||||||||||||||||||||||||||||
| 1311 | { | - | ||||||||||||||||||||||||||||||||||||
| 1312 | return executed 1279 times by 3 tests: inputMethodQuery(property, QVariant());return inputMethodQuery(property, QVariant());Executed by:
executed 1279 times by 3 tests: return inputMethodQuery(property, QVariant());Executed by:
| 1279 | ||||||||||||||||||||||||||||||||||||
| 1313 | } | - | ||||||||||||||||||||||||||||||||||||
| 1314 | - | |||||||||||||||||||||||||||||||||||||
| 1315 | QVariant 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: Qt::ImEnabled:case Qt::ImEnabled:Executed by:
executed 531 times by 3 tests: case Qt::ImEnabled:Executed by:
| 531 | ||||||||||||||||||||||||||||||||||||
| 1320 | return executed 531 times by 3 tests: QVariant((bool)(flags() & ItemAcceptsInputMethod));return QVariant((bool)(flags() & ItemAcceptsInputMethod));Executed by:
executed 531 times by 3 tests: return QVariant((bool)(flags() & ItemAcceptsInputMethod));Executed by:
| 531 | ||||||||||||||||||||||||||||||||||||
| 1321 | case executed 396 times by 3 tests: Qt::ImHints:case Qt::ImHints:Executed by:
executed 396 times by 3 tests: case Qt::ImHints:Executed by:
| 396 | ||||||||||||||||||||||||||||||||||||
| 1322 | return executed 396 times by 3 tests: QVariant((int) d->effectiveInputMethodHints());return QVariant((int) d->effectiveInputMethodHints());Executed by:
executed 396 times by 3 tests: return QVariant((int) d->effectiveInputMethodHints());Executed by:
| 396 | ||||||||||||||||||||||||||||||||||||
| 1323 | case executed 344 times by 1 test: Qt::ImCursorRectangle:case Qt::ImCursorRectangle:Executed by:
executed 344 times by 1 test: case Qt::ImCursorRectangle:Executed by:
| 344 | ||||||||||||||||||||||||||||||||||||
| 1324 | return executed 344 times by 1 test: cursorRectangle();return cursorRectangle();Executed by:
executed 344 times by 1 test: return cursorRectangle();Executed by:
| 344 | ||||||||||||||||||||||||||||||||||||
| 1325 | case never executed: Qt::ImAnchorRectangle:case Qt::ImAnchorRectangle:never executed: case Qt::ImAnchorRectangle: | 0 | ||||||||||||||||||||||||||||||||||||
| 1326 | return never executed: d->anchorRectangle();return d->anchorRectangle();never executed: return d->anchorRectangle(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1327 | case never executed: Qt::ImFont:case Qt::ImFont:never executed: case Qt::ImFont: | 0 | ||||||||||||||||||||||||||||||||||||
| 1328 | return never executed: font();return font();never executed: return font(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1329 | case never executed: Qt::ImCursorPosition:case Qt::ImCursorPosition:never executed: {case Qt::ImCursorPosition: | 0 | ||||||||||||||||||||||||||||||||||||
| 1330 | const QPointF pt = argument.toPointF(); | - | ||||||||||||||||||||||||||||||||||||
| 1331 | if (!pt.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1332 | return never executed: QVariant(d->positionAt(pt));return QVariant(d->positionAt(pt));never executed: return QVariant(d->positionAt(pt)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1333 | return never executed: QVariant(d->m_cursor);return QVariant(d->m_cursor);never executed: return QVariant(d->m_cursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 1334 | } | - | ||||||||||||||||||||||||||||||||||||
| 1335 | case executed 8 times by 1 test: Qt::ImSurroundingText:case Qt::ImSurroundingText:Executed by:
executed 8 times by 1 test: case Qt::ImSurroundingText:Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1336 | if (d->m_echoMode == PasswordEchoOnEdit
| 0-8 | ||||||||||||||||||||||||||||||||||||
| 1337 | return executed 4 times by 1 test: QVariant(displayText());return QVariant(displayText());Executed by:
executed 4 times by 1 test: return QVariant(displayText());Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1338 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 1339 | return executed 4 times by 1 test: QVariant(d->realText());return QVariant(d->realText());Executed by:
executed 4 times by 1 test: return QVariant(d->realText());Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1340 | } | - | ||||||||||||||||||||||||||||||||||||
| 1341 | case never executed: Qt::ImCurrentSelection:case Qt::ImCurrentSelection:never executed: case Qt::ImCurrentSelection: | 0 | ||||||||||||||||||||||||||||||||||||
| 1342 | return never executed: QVariant(selectedText());return QVariant(selectedText());never executed: return QVariant(selectedText()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1343 | case never executed: Qt::ImMaximumTextLength:case Qt::ImMaximumTextLength:never executed: case Qt::ImMaximumTextLength: | 0 | ||||||||||||||||||||||||||||||||||||
| 1344 | return never executed: QVariant(maxLength());return QVariant(maxLength());never executed: return QVariant(maxLength()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1345 | case never executed: Qt::ImAnchorPosition:case Qt::ImAnchorPosition:never executed: case Qt::ImAnchorPosition: | 0 | ||||||||||||||||||||||||||||||||||||
| 1346 | if (d->selectionStart() == d->selectionEnd()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1347 | return never executed: QVariant(d->m_cursor);return QVariant(d->m_cursor);never executed: return QVariant(d->m_cursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 1348 | else if (d->selectionStart() == d->m_cursor
| 0 | ||||||||||||||||||||||||||||||||||||
| 1349 | return never executed: QVariant(d->selectionEnd());return QVariant(d->selectionEnd());never executed: return QVariant(d->selectionEnd()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1350 | else | - | ||||||||||||||||||||||||||||||||||||
| 1351 | return never executed: QVariant(d->selectionStart());return QVariant(d->selectionStart());never executed: return QVariant(d->selectionStart()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1352 | case never executed: Qt::ImAbsolutePosition:case Qt::ImAbsolutePosition:never executed: case Qt::ImAbsolutePosition: | 0 | ||||||||||||||||||||||||||||||||||||
| 1353 | return never executed: QVariant(d->m_cursor);return QVariant(d->m_cursor);never executed: return QVariant(d->m_cursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 1354 | case never executed: Qt::ImTextAfterCursor:case Qt::ImTextAfterCursor:never executed: case Qt::ImTextAfterCursor: | 0 | ||||||||||||||||||||||||||||||||||||
| 1355 | if (argument.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1356 | return never executed: QVariant(d->m_text.mid(d->m_cursor, argument.toInt()));return 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: QVariant(d->m_text.mid(d->m_cursor));return QVariant(d->m_text.mid(d->m_cursor));never executed: return QVariant(d->m_text.mid(d->m_cursor)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1358 | case never executed: Qt::ImTextBeforeCursor:case Qt::ImTextBeforeCursor:never executed: case Qt::ImTextBeforeCursor: | 0 | ||||||||||||||||||||||||||||||||||||
| 1359 | if (argument.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1360 | return never executed: QVariant(d->m_text.leftRef(d->m_cursor).right(argument.toInt()).toString());return 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: QVariant(d->m_text.left(d->m_cursor));return 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: QQuickItem::inputMethodQuery(property);return QQuickItem::inputMethodQuery(property);never executed: return QQuickItem::inputMethodQuery(property); | 0 | ||||||||||||||||||||||||||||||||||||
| 1364 | } | - | ||||||||||||||||||||||||||||||||||||
| 1365 | } | - | ||||||||||||||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||||||||||||||
| 1367 | - | |||||||||||||||||||||||||||||||||||||
| 1368 | - | |||||||||||||||||||||||||||||||||||||
| 1369 | - | |||||||||||||||||||||||||||||||||||||
| 1370 | - | |||||||||||||||||||||||||||||||||||||
| 1371 | - | |||||||||||||||||||||||||||||||||||||
| 1372 | - | |||||||||||||||||||||||||||||||||||||
| 1373 | void QQuickTextInput::deselect() | - | ||||||||||||||||||||||||||||||||||||
| 1374 | { | - | ||||||||||||||||||||||||||||||||||||
| 1375 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1376 | d->deselect(); | - | ||||||||||||||||||||||||||||||||||||
| 1377 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1378 | - | |||||||||||||||||||||||||||||||||||||
| 1379 | - | |||||||||||||||||||||||||||||||||||||
| 1380 | - | |||||||||||||||||||||||||||||||||||||
| 1381 | - | |||||||||||||||||||||||||||||||||||||
| 1382 | - | |||||||||||||||||||||||||||||||||||||
| 1383 | - | |||||||||||||||||||||||||||||||||||||
| 1384 | void QQuickTextInput::selectAll() | - | ||||||||||||||||||||||||||||||||||||
| 1385 | { | - | ||||||||||||||||||||||||||||||||||||
| 1386 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1387 | d->setSelection(0, text().length()); | - | ||||||||||||||||||||||||||||||||||||
| 1388 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||||||||||||||
| 1390 | - | |||||||||||||||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||||||||||||||
| 1392 | - | |||||||||||||||||||||||||||||||||||||
| 1393 | - | |||||||||||||||||||||||||||||||||||||
| 1394 | - | |||||||||||||||||||||||||||||||||||||
| 1395 | - | |||||||||||||||||||||||||||||||||||||
| 1396 | bool QQuickTextInput::isRightToLeft(int start, int end) | - | ||||||||||||||||||||||||||||||||||||
| 1397 | { | - | ||||||||||||||||||||||||||||||||||||
| 1398 | if (start > end
| 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: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1401 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 1402 | return executed 164 times by 1 test: text().midRef(start, end - start).isRightToLeft();return text().midRef(start, end - start).isRightToLeft();Executed by:
executed 164 times by 1 test: return text().midRef(start, end - start).isRightToLeft();Executed by:
| 164 | ||||||||||||||||||||||||||||||||||||
| 1403 | } | - | ||||||||||||||||||||||||||||||||||||
| 1404 | } | - | ||||||||||||||||||||||||||||||||||||
| 1405 | void QQuickTextInput::cut() | - | ||||||||||||||||||||||||||||||||||||
| 1406 | { | - | ||||||||||||||||||||||||||||||||||||
| 1407 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1408 | if (!d->m_readOnly
| 0-8 | ||||||||||||||||||||||||||||||||||||
| 1409 | d->copy(); | - | ||||||||||||||||||||||||||||||||||||
| 1410 | d->del(); | - | ||||||||||||||||||||||||||||||||||||
| 1411 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1412 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1413 | void QQuickTextInput::copy() | - | ||||||||||||||||||||||||||||||||||||
| 1414 | { | - | ||||||||||||||||||||||||||||||||||||
| 1415 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1416 | d->copy(); | - | ||||||||||||||||||||||||||||||||||||
| 1417 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||||||||||||||
| 1419 | - | |||||||||||||||||||||||||||||||||||||
| 1420 | - | |||||||||||||||||||||||||||||||||||||
| 1421 | - | |||||||||||||||||||||||||||||||||||||
| 1422 | - | |||||||||||||||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||||||||||||||
| 1424 | void QQuickTextInput::paste() | - | ||||||||||||||||||||||||||||||||||||
| 1425 | { | - | ||||||||||||||||||||||||||||||||||||
| 1426 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1427 | if (!d->m_readOnly
| 2-6 | ||||||||||||||||||||||||||||||||||||
| 1428 | d->paste(); executed 6 times by 1 test: d->paste();Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1429 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1430 | void QQuickTextInput::undo() | - | ||||||||||||||||||||||||||||||||||||
| 1431 | { | - | ||||||||||||||||||||||||||||||||||||
| 1432 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1433 | if (!d->m_readOnly
| 0-164 | ||||||||||||||||||||||||||||||||||||
| 1434 | d->resetInputMethod(); | - | ||||||||||||||||||||||||||||||||||||
| 1435 | d->internalUndo(); | - | ||||||||||||||||||||||||||||||||||||
| 1436 | d->finishChange(-1, true); | - | ||||||||||||||||||||||||||||||||||||
| 1437 | } executed 164 times by 1 test: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||||||||||||||
| 1438 | } executed 164 times by 1 test: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||||||||||||||
| 1439 | - | |||||||||||||||||||||||||||||||||||||
| 1440 | - | |||||||||||||||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||||||||||||||
| 1446 | void QQuickTextInput::redo() | - | ||||||||||||||||||||||||||||||||||||
| 1447 | { | - | ||||||||||||||||||||||||||||||||||||
| 1448 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1449 | if (!d->m_readOnly
| 0-12 | ||||||||||||||||||||||||||||||||||||
| 1450 | d->resetInputMethod(); | - | ||||||||||||||||||||||||||||||||||||
| 1451 | d->internalRedo(); | - | ||||||||||||||||||||||||||||||||||||
| 1452 | d->finishChange(); | - | ||||||||||||||||||||||||||||||||||||
| 1453 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 1454 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 1455 | - | |||||||||||||||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||||||||||||||
| 1457 | - | |||||||||||||||||||||||||||||||||||||
| 1458 | - | |||||||||||||||||||||||||||||||||||||
| 1459 | - | |||||||||||||||||||||||||||||||||||||
| 1460 | - | |||||||||||||||||||||||||||||||||||||
| 1461 | - | |||||||||||||||||||||||||||||||||||||
| 1462 | void QQuickTextInput::insert(int position, const QString &text) | - | ||||||||||||||||||||||||||||||||||||
| 1463 | { | - | ||||||||||||||||||||||||||||||||||||
| 1464 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1465 | if (d->m_echoMode == QQuickTextInput::Password
| 0-126 | ||||||||||||||||||||||||||||||||||||
| 1466 | if (d->m_passwordMaskDelay > 0
| 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
| 2-122 | ||||||||||||||||||||||||||||||||||||
| 1470 | return; executed 6 times by 1 test: return;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||||||||||||||
| 1472 | const int priorState = d->m_undoState; | - | ||||||||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||||||||
| 1474 | QString insertText = text; | - | ||||||||||||||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||||||||||||||
| 1476 | if (d->hasSelectedText()
| 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 blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 1480 | if (d->m_maskData
| 28-92 | ||||||||||||||||||||||||||||||||||||
| 1481 | insertText = d->maskString(position, insertText); | - | ||||||||||||||||||||||||||||||||||||
| 1482 | for (int i = 0; i < insertText.length()
| 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 blockExecuted by:
| 538 | ||||||||||||||||||||||||||||||||||||
| 1488 | d->m_text.replace(position, insertText.length(), insertText); | - | ||||||||||||||||||||||||||||||||||||
| 1489 | if (!insertText.isEmpty()
| 10-82 | ||||||||||||||||||||||||||||||||||||
| 1490 | d->m_textDirty = true; executed 82 times by 1 test: d->m_textDirty = true;Executed by:
| 82 | ||||||||||||||||||||||||||||||||||||
| 1491 | if (position < d->m_selend
| 4-84 | ||||||||||||||||||||||||||||||||||||
| 1492 | d->m_selDirty = true; executed 4 times by 1 test: d->m_selDirty = true;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1493 | } executed 92 times by 1 test: else {end of blockExecuted by:
| 92 | ||||||||||||||||||||||||||||||||||||
| 1494 | int remaining = d->m_maxLength - d->m_text.length(); | - | ||||||||||||||||||||||||||||||||||||
| 1495 | if (remaining != 0
| 0-28 | ||||||||||||||||||||||||||||||||||||
| 1496 | insertText = insertText.left(remaining); | - | ||||||||||||||||||||||||||||||||||||
| 1497 | d->m_text.insert(position, insertText); | - | ||||||||||||||||||||||||||||||||||||
| 1498 | for (int i = 0; i < insertText.length()
| 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:
| 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:
| 154 | ||||||||||||||||||||||||||||||||||||
| 1501 | if (d->m_cursor >= position
| 10-18 | ||||||||||||||||||||||||||||||||||||
| 1502 | d->m_cursor += insertText.length(); executed 18 times by 1 test: d->m_cursor += insertText.length();Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 1503 | if (d->m_selstart >= position
| 10-18 | ||||||||||||||||||||||||||||||||||||
| 1504 | d->m_selstart += insertText.length(); executed 10 times by 1 test: d->m_selstart += insertText.length();Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1505 | if (d->m_selend >= position
| 14 | ||||||||||||||||||||||||||||||||||||
| 1506 | d->m_selend += insertText.length(); executed 14 times by 1 test: d->m_selend += insertText.length();Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 1507 | d->m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 1508 | if (position >= d->m_selstart
| 4-18 | ||||||||||||||||||||||||||||||||||||
| 1509 | d->m_selDirty = true; executed 4 times by 1 test: d->m_selDirty = true;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1510 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1511 | } executed 28 times by 1 test: end of blockExecuted by:
| 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
| 24-96 | ||||||||||||||||||||||||||||||||||||
| 1518 | if (d->m_selstart != d->lastSelectionStart
| 4-20 | ||||||||||||||||||||||||||||||||||||
| 1519 | d->lastSelectionStart = d->m_selstart; | - | ||||||||||||||||||||||||||||||||||||
| 1520 | selectionStartChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1521 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1522 | if (d->m_selend != d->lastSelectionEnd
| 4-20 | ||||||||||||||||||||||||||||||||||||
| 1523 | d->lastSelectionEnd = d->m_selend; | - | ||||||||||||||||||||||||||||||||||||
| 1524 | selectionEndChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1525 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1526 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 1527 | } executed 120 times by 1 test: end of blockExecuted by:
| 120 | ||||||||||||||||||||||||||||||||||||
| 1528 | - | |||||||||||||||||||||||||||||||||||||
| 1529 | - | |||||||||||||||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||||||||||||||
| 1531 | - | |||||||||||||||||||||||||||||||||||||
| 1532 | - | |||||||||||||||||||||||||||||||||||||
| 1533 | - | |||||||||||||||||||||||||||||||||||||
| 1534 | - | |||||||||||||||||||||||||||||||||||||
| 1535 | void 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
| 4-60 | ||||||||||||||||||||||||||||||||||||
| 1543 | qSwap(start, end); executed 4 times by 1 test: qSwap(start, end);Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1544 | else if (start == end
| 0-60 | ||||||||||||||||||||||||||||||||||||
| 1545 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1546 | - | |||||||||||||||||||||||||||||||||||||
| 1547 | if (start < d->m_selend
| 8-48 | ||||||||||||||||||||||||||||||||||||
| 1548 | d->m_selDirty = true; executed 8 times by 1 test: d->m_selDirty = true;Executed by:
| 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
| 18-44 | ||||||||||||||||||||||||||||||||||||
| 1556 | - | |||||||||||||||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||||||||||||||
| 1558 | for (int i = d->m_cursor; i >= start
| 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 blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 1562 | for (int i = end - 1; i > d->m_cursor
| 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 blockExecuted by:
| 162 | ||||||||||||||||||||||||||||||||||||
| 1566 | } executed 18 times by 1 test: else {end of blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 1567 | for (int i = end - 1; i >= start
| 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 blockExecuted by:
| 212 | ||||||||||||||||||||||||||||||||||||
| 1571 | } executed 46 times by 1 test: end of blockExecuted by:
| 46 | ||||||||||||||||||||||||||||||||||||
| 1572 | if (d->m_maskData
| 26-38 | ||||||||||||||||||||||||||||||||||||
| 1573 | d->m_text.replace(start, end - start, d->clearString(start, end - start)); | - | ||||||||||||||||||||||||||||||||||||
| 1574 | for (int i = 0; i < end - start
| 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 blockExecuted by:
| 94 | ||||||||||||||||||||||||||||||||||||
| 1578 | } executed 26 times by 1 test: else {end of blockExecuted by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 1579 | d->m_text.remove(start, end - start); | - | ||||||||||||||||||||||||||||||||||||
| 1580 | - | |||||||||||||||||||||||||||||||||||||
| 1581 | if (d->m_cursor > start
| 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:
| 16 | ||||||||||||||||||||||||||||||||||||
| 1583 | if (d->m_selstart > start
| 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:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1585 | if (d->m_selend > end
| 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:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1587 | } executed 38 times by 1 test: end of blockExecuted by:
| 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
| 24-40 | ||||||||||||||||||||||||||||||||||||
| 1595 | if (d->m_selstart != d->lastSelectionStart
| 4-20 | ||||||||||||||||||||||||||||||||||||
| 1596 | d->lastSelectionStart = d->m_selstart; | - | ||||||||||||||||||||||||||||||||||||
| 1597 | selectionStartChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1598 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1599 | if (d->m_selend != d->lastSelectionEnd
| 4-20 | ||||||||||||||||||||||||||||||||||||
| 1600 | d->lastSelectionEnd = d->m_selend; | - | ||||||||||||||||||||||||||||||||||||
| 1601 | selectionEndChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1602 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1603 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 1604 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||||||||||||||
| 1605 | - | |||||||||||||||||||||||||||||||||||||
| 1606 | - | |||||||||||||||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||||||||||||||
| 1608 | - | |||||||||||||||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||||||||||||||
| 1610 | - | |||||||||||||||||||||||||||||||||||||
| 1611 | - | |||||||||||||||||||||||||||||||||||||
| 1612 | void QQuickTextInput::selectWord() | - | ||||||||||||||||||||||||||||||||||||
| 1613 | { | - | ||||||||||||||||||||||||||||||||||||
| 1614 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1615 | d->selectWordAtPos(d->m_cursor); | - | ||||||||||||||||||||||||||||||||||||
| 1616 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1617 | QString QQuickTextInput::passwordCharacter() const | - | ||||||||||||||||||||||||||||||||||||
| 1618 | { | - | ||||||||||||||||||||||||||||||||||||
| 1619 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1620 | return executed 4 times by 1 test: QString(d->m_passwordCharacter);return QString(d->m_passwordCharacter);Executed by:
executed 4 times by 1 test: return QString(d->m_passwordCharacter);Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1621 | } | - | ||||||||||||||||||||||||||||||||||||
| 1622 | - | |||||||||||||||||||||||||||||||||||||
| 1623 | void QQuickTextInput::setPasswordCharacter(const QString &str) | - | ||||||||||||||||||||||||||||||||||||
| 1624 | { | - | ||||||||||||||||||||||||||||||||||||
| 1625 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1626 | if (str.length() < 1
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 1627 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1628 | d->m_passwordCharacter = str.constData()[0]; | - | ||||||||||||||||||||||||||||||||||||
| 1629 | if (d->m_echoMode == Password
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 1630 | d->updateDisplayText(); executed 6 times by 1 test: d->updateDisplayText();Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1631 | passwordCharacterChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1632 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1633 | int QQuickTextInput::passwordMaskDelay() const | - | ||||||||||||||||||||||||||||||||||||
| 1634 | { | - | ||||||||||||||||||||||||||||||||||||
| 1635 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1636 | return never executed: d->m_passwordMaskDelay;return d->m_passwordMaskDelay;never executed: return d->m_passwordMaskDelay; | 0 | ||||||||||||||||||||||||||||||||||||
| 1637 | } | - | ||||||||||||||||||||||||||||||||||||
| 1638 | - | |||||||||||||||||||||||||||||||||||||
| 1639 | void QQuickTextInput::setPasswordMaskDelay(int delay) | - | ||||||||||||||||||||||||||||||||||||
| 1640 | { | - | ||||||||||||||||||||||||||||||||||||
| 1641 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1642 | if (d->m_passwordMaskDelay != delay
| 0 | ||||||||||||||||||||||||||||||||||||
| 1643 | d->m_passwordMaskDelay = delay; | - | ||||||||||||||||||||||||||||||||||||
| 1644 | passwordMaskDelayChanged(delay); | - | ||||||||||||||||||||||||||||||||||||
| 1645 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1646 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1647 | - | |||||||||||||||||||||||||||||||||||||
| 1648 | void QQuickTextInput::resetPasswordMaskDelay() | - | ||||||||||||||||||||||||||||||||||||
| 1649 | { | - | ||||||||||||||||||||||||||||||||||||
| 1650 | setPasswordMaskDelay((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->passwordMaskDelay()); | - | ||||||||||||||||||||||||||||||||||||
| 1651 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1652 | QString QQuickTextInput::displayText() const | - | ||||||||||||||||||||||||||||||||||||
| 1653 | { | - | ||||||||||||||||||||||||||||||||||||
| 1654 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1655 | return executed 176 times by 1 test: d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());return d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());Executed by:
executed 176 times by 1 test: return d->m_textLayout.text().insert(d->m_textLayout.preeditAreaPosition(), d->m_textLayout.preeditAreaText());Executed by:
| 176 | ||||||||||||||||||||||||||||||||||||
| 1656 | } | - | ||||||||||||||||||||||||||||||||||||
| 1657 | QString QQuickTextInput::preeditText() const | - | ||||||||||||||||||||||||||||||||||||
| 1658 | { | - | ||||||||||||||||||||||||||||||||||||
| 1659 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1660 | return executed 8 times by 1 test: d->m_textLayout.preeditAreaText();return d->m_textLayout.preeditAreaText();Executed by:
executed 8 times by 1 test: return d->m_textLayout.preeditAreaText();Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1661 | } | - | ||||||||||||||||||||||||||||||||||||
| 1662 | bool QQuickTextInput::selectByMouse() const | - | ||||||||||||||||||||||||||||||||||||
| 1663 | { | - | ||||||||||||||||||||||||||||||||||||
| 1664 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1665 | return executed 6 times by 1 test: d->selectByMouse;return d->selectByMouse;Executed by:
executed 6 times by 1 test: return d->selectByMouse;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1666 | } | - | ||||||||||||||||||||||||||||||||||||
| 1667 | - | |||||||||||||||||||||||||||||||||||||
| 1668 | void QQuickTextInput::setSelectByMouse(bool on) | - | ||||||||||||||||||||||||||||||||||||
| 1669 | { | - | ||||||||||||||||||||||||||||||||||||
| 1670 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1671 | if (d->selectByMouse != on
| 2-40 | ||||||||||||||||||||||||||||||||||||
| 1672 | d->selectByMouse = on; | - | ||||||||||||||||||||||||||||||||||||
| 1673 | selectByMouseChanged(on); | - | ||||||||||||||||||||||||||||||||||||
| 1674 | } executed 40 times by 2 tests: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||||||||||||||
| 1675 | } executed 42 times by 2 tests: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 1676 | QQuickTextInput::SelectionMode QQuickTextInput::mouseSelectionMode() const | - | ||||||||||||||||||||||||||||||||||||
| 1677 | { | - | ||||||||||||||||||||||||||||||||||||
| 1678 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1679 | return executed 6 times by 1 test: d->mouseSelectionMode;return d->mouseSelectionMode;Executed by:
executed 6 times by 1 test: return d->mouseSelectionMode;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1680 | } | - | ||||||||||||||||||||||||||||||||||||
| 1681 | - | |||||||||||||||||||||||||||||||||||||
| 1682 | void QQuickTextInput::setMouseSelectionMode(SelectionMode mode) | - | ||||||||||||||||||||||||||||||||||||
| 1683 | { | - | ||||||||||||||||||||||||||||||||||||
| 1684 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1685 | if (d->mouseSelectionMode != mode
| 8-10 | ||||||||||||||||||||||||||||||||||||
| 1686 | d->mouseSelectionMode = mode; | - | ||||||||||||||||||||||||||||||||||||
| 1687 | mouseSelectionModeChanged(mode); | - | ||||||||||||||||||||||||||||||||||||
| 1688 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1689 | } executed 18 times by 1 test: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 1690 | bool QQuickTextInput::persistentSelection() const | - | ||||||||||||||||||||||||||||||||||||
| 1691 | { | - | ||||||||||||||||||||||||||||||||||||
| 1692 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1693 | return executed 6 times by 1 test: d->persistentSelection;return d->persistentSelection;Executed by:
executed 6 times by 1 test: return d->persistentSelection;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1694 | } | - | ||||||||||||||||||||||||||||||||||||
| 1695 | - | |||||||||||||||||||||||||||||||||||||
| 1696 | void QQuickTextInput::setPersistentSelection(bool on) | - | ||||||||||||||||||||||||||||||||||||
| 1697 | { | - | ||||||||||||||||||||||||||||||||||||
| 1698 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1699 | if (d->persistentSelection == on
| 2 | ||||||||||||||||||||||||||||||||||||
| 1700 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1701 | d->persistentSelection = on; | - | ||||||||||||||||||||||||||||||||||||
| 1702 | persistentSelectionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1703 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1704 | - | |||||||||||||||||||||||||||||||||||||
| 1705 | - | |||||||||||||||||||||||||||||||||||||
| 1706 | - | |||||||||||||||||||||||||||||||||||||
| 1707 | - | |||||||||||||||||||||||||||||||||||||
| 1708 | - | |||||||||||||||||||||||||||||||||||||
| 1709 | - | |||||||||||||||||||||||||||||||||||||
| 1710 | - | |||||||||||||||||||||||||||||||||||||
| 1711 | bool QQuickTextInput::canPaste() const | - | ||||||||||||||||||||||||||||||||||||
| 1712 | { | - | ||||||||||||||||||||||||||||||||||||
| 1713 | - | |||||||||||||||||||||||||||||||||||||
| 1714 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1715 | if (!d->canPasteValid
| 4-32 | ||||||||||||||||||||||||||||||||||||
| 1716 | if (const
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 1717 | const_cast< executed 4 times by 1 test: QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnlyconst_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText();Executed by:
executed 4 times by 1 test: const_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText();Executed by:
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 1718 | const_cast<QQuickTextInputPrivate *>(d)->canPasteValid = true; | - | ||||||||||||||||||||||||||||||||||||
| 1719 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1720 | return executed 36 times by 1 test: d->canPaste;return d->canPaste;Executed by:
executed 36 times by 1 test: return d->canPaste;Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1721 | - | |||||||||||||||||||||||||||||||||||||
| 1722 | - | |||||||||||||||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||||||||||||||
| 1724 | } | - | ||||||||||||||||||||||||||||||||||||
| 1725 | bool QQuickTextInput::canUndo() const | - | ||||||||||||||||||||||||||||||||||||
| 1726 | { | - | ||||||||||||||||||||||||||||||||||||
| 1727 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1728 | return executed 100 times by 1 test: d->canUndo;return d->canUndo;Executed by:
executed 100 times by 1 test: return d->canUndo;Executed by:
| 100 | ||||||||||||||||||||||||||||||||||||
| 1729 | } | - | ||||||||||||||||||||||||||||||||||||
| 1730 | bool QQuickTextInput::canRedo() const | - | ||||||||||||||||||||||||||||||||||||
| 1731 | { | - | ||||||||||||||||||||||||||||||||||||
| 1732 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1733 | return executed 28 times by 1 test: d->canRedo;return d->canRedo;Executed by:
executed 28 times by 1 test: return d->canRedo;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1734 | } | - | ||||||||||||||||||||||||||||||||||||
| 1735 | qreal QQuickTextInput::contentWidth() const | - | ||||||||||||||||||||||||||||||||||||
| 1736 | { | - | ||||||||||||||||||||||||||||||||||||
| 1737 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1738 | return executed 136 times by 1 test: d->contentSize.width();return d->contentSize.width();Executed by:
executed 136 times by 1 test: return d->contentSize.width();Executed by:
| 136 | ||||||||||||||||||||||||||||||||||||
| 1739 | } | - | ||||||||||||||||||||||||||||||||||||
| 1740 | qreal QQuickTextInput::contentHeight() const | - | ||||||||||||||||||||||||||||||||||||
| 1741 | { | - | ||||||||||||||||||||||||||||||||||||
| 1742 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1743 | return executed 194 times by 1 test: d->contentSize.height();return d->contentSize.height();Executed by:
executed 194 times by 1 test: return d->contentSize.height();Executed by:
| 194 | ||||||||||||||||||||||||||||||||||||
| 1744 | } | - | ||||||||||||||||||||||||||||||||||||
| 1745 | - | |||||||||||||||||||||||||||||||||||||
| 1746 | void 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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1751 | void QQuickTextInput::moveCursorSelection(int pos, SelectionMode mode) | - | ||||||||||||||||||||||||||||||||||||
| 1752 | { | - | ||||||||||||||||||||||||||||||||||||
| 1753 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1754 | - | |||||||||||||||||||||||||||||||||||||
| 1755 | if (mode == SelectCharacters
| 82-302 | ||||||||||||||||||||||||||||||||||||
| 1756 | d->moveCursor(pos, true); | - | ||||||||||||||||||||||||||||||||||||
| 1757 | } executed 82 times by 1 test: else if (pos != d->m_cursorend of blockExecuted by:
| 52-250 | ||||||||||||||||||||||||||||||||||||
| 1758 | const int cursor = d->m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 1759 | int anchor; | - | ||||||||||||||||||||||||||||||||||||
| 1760 | if (!d->hasSelectedText()
| 56-194 | ||||||||||||||||||||||||||||||||||||
| 1761 | anchor = d->m_cursor; executed 194 times by 1 test: anchor = d->m_cursor;Executed by:
| 194 | ||||||||||||||||||||||||||||||||||||
| 1762 | else if (d->selectionStart() == d->m_cursor
| 28 | ||||||||||||||||||||||||||||||||||||
| 1763 | anchor = d->selectionEnd(); executed 28 times by 1 test: anchor = d->selectionEnd();Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1764 | else | - | ||||||||||||||||||||||||||||||||||||
| 1765 | anchor = d->selectionStart(); executed 28 times by 1 test: anchor = d->selectionStart();Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 1766 | - | |||||||||||||||||||||||||||||||||||||
| 1767 | if (anchor < pos
| 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()
| 2-126 | ||||||||||||||||||||||||||||||||||||
| 1774 | || (reasons & QTextBoundaryFinder::EndOfItem))) { | - | ||||||||||||||||||||||||||||||||||||
| 1775 | finder.toPreviousBoundary(); | - | ||||||||||||||||||||||||||||||||||||
| 1776 | } executed 78 times by 1 test: end of blockExecuted by:
| 78 | ||||||||||||||||||||||||||||||||||||
| 1777 | anchor = finder.position() != -1
| 0-128 | ||||||||||||||||||||||||||||||||||||
| 1778 | - | |||||||||||||||||||||||||||||||||||||
| 1779 | finder.setPosition(pos); | - | ||||||||||||||||||||||||||||||||||||
| 1780 | if (pos > 0
| 0-128 | ||||||||||||||||||||||||||||||||||||
| 1781 | finder.toNextBoundary(); executed 62 times by 1 test: finder.toNextBoundary();Executed by:
| 62 | ||||||||||||||||||||||||||||||||||||
| 1782 | const int cursor = finder.position() != -1
| 0-128 | ||||||||||||||||||||||||||||||||||||
| 1783 | - | |||||||||||||||||||||||||||||||||||||
| 1784 | d->setSelection(anchor, cursor - anchor); | - | ||||||||||||||||||||||||||||||||||||
| 1785 | } executed 128 times by 1 test: else if (anchor > posend of blockExecuted by:
| 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
| 2-120 | ||||||||||||||||||||||||||||||||||||
| 1792 | || (reasons & QTextBoundaryFinder::StartOfItem))) { | - | ||||||||||||||||||||||||||||||||||||
| 1793 | finder.toNextBoundary(); | - | ||||||||||||||||||||||||||||||||||||
| 1794 | } executed 74 times by 1 test: end of blockExecuted by:
| 74 | ||||||||||||||||||||||||||||||||||||
| 1795 | anchor = finder.position() != -1
| 0-122 | ||||||||||||||||||||||||||||||||||||
| 1796 | - | |||||||||||||||||||||||||||||||||||||
| 1797 | finder.setPosition(pos); | - | ||||||||||||||||||||||||||||||||||||
| 1798 | if (pos < text.length()
| 0-122 | ||||||||||||||||||||||||||||||||||||
| 1799 | finder.toPreviousBoundary(); executed 36 times by 1 test: finder.toPreviousBoundary();Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1800 | const int cursor = finder.position() != -1
| 0-122 | ||||||||||||||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||||||||||||||
| 1802 | d->setSelection(anchor, cursor - anchor); | - | ||||||||||||||||||||||||||||||||||||
| 1803 | } executed 122 times by 1 test: end of blockExecuted by:
| 122 | ||||||||||||||||||||||||||||||||||||
| 1804 | } executed 250 times by 1 test: end of blockExecuted by:
| 250 | ||||||||||||||||||||||||||||||||||||
| 1805 | } executed 384 times by 1 test: end of blockExecuted by:
| 384 | ||||||||||||||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||||||||||||||
| 1807 | void 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 blockExecuted by:
| 384 | ||||||||||||||||||||||||||||||||||||
| 1813 | - | |||||||||||||||||||||||||||||||||||||
| 1814 | void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 1815 | { | - | ||||||||||||||||||||||||||||||||||||
| 1816 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1817 | bool focus = event->gotFocus(); | - | ||||||||||||||||||||||||||||||||||||
| 1818 | if (!m_readOnly
| 20-502 | ||||||||||||||||||||||||||||||||||||
| 1819 | q->setCursorVisible(focus); | - | ||||||||||||||||||||||||||||||||||||
| 1820 | setBlinkingCursorEnabled(focus); | - | ||||||||||||||||||||||||||||||||||||
| 1821 | } executed 502 times by 3 tests: end of blockExecuted by:
| 502 | ||||||||||||||||||||||||||||||||||||
| 1822 | if (focus
| 138-384 | ||||||||||||||||||||||||||||||||||||
| 1823 | q->q_updateAlignment(); | - | ||||||||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||||||||
| 1825 | if (focusOnPress
| 2-382 | ||||||||||||||||||||||||||||||||||||
| 1826 | (static_cast< executed 372 times by 3 tests: QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();(static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();Executed by:
executed 372 times by 3 tests: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->inputMethod()->show();Executed by:
| 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: else {end of blockExecuted by:
| 384 | ||||||||||||||||||||||||||||||||||||
| 1831 | if ((m_passwordEchoEditing
| 0-134 | ||||||||||||||||||||||||||||||||||||
| 1832 | updatePasswordEchoEditing(false); | - | ||||||||||||||||||||||||||||||||||||
| 1833 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 1834 | - | |||||||||||||||||||||||||||||||||||||
| 1835 | if (event->reason() != Qt::ActiveWindowFocusReason
| 4-134 | ||||||||||||||||||||||||||||||||||||
| 1836 | && event->reason() != Qt::PopupFocusReason
| 0-134 | ||||||||||||||||||||||||||||||||||||
| 1837 | && hasSelectedText()
| 8-126 | ||||||||||||||||||||||||||||||||||||
| 1838 | && !persistentSelection
| 2-6 | ||||||||||||||||||||||||||||||||||||
| 1839 | deselect(); executed 6 times by 1 test: deselect();Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1840 | - | |||||||||||||||||||||||||||||||||||||
| 1841 | if (hasAcceptableInput(m_text) == AcceptableInput
| 0-136 | ||||||||||||||||||||||||||||||||||||
| 1842 | q->editingFinished(); executed 138 times by 3 tests: q->editingFinished();Executed by:
| 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 blockExecuted by:
| 138 | ||||||||||||||||||||||||||||||||||||
| 1849 | } | - | ||||||||||||||||||||||||||||||||||||
| 1850 | - | |||||||||||||||||||||||||||||||||||||
| 1851 | void 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 blockExecuted by:
| 138 | ||||||||||||||||||||||||||||||||||||
| 1857 | bool QQuickTextInput::isInputMethodComposing() const | - | ||||||||||||||||||||||||||||||||||||
| 1858 | { | - | ||||||||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||||||||
| 1862 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1863 | return executed 24 times by 1 test: d->hasImState;return d->hasImState;Executed by:
executed 24 times by 1 test: return d->hasImState;Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 1864 | - | |||||||||||||||||||||||||||||||||||||
| 1865 | } | - | ||||||||||||||||||||||||||||||||||||
| 1866 | - | |||||||||||||||||||||||||||||||||||||
| 1867 | QQuickTextInputPrivate::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 blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 1880 | - | |||||||||||||||||||||||||||||||||||||
| 1881 | void QQuickTextInputPrivate::init() | - | ||||||||||||||||||||||||||||||||||||
| 1882 | { | - | ||||||||||||||||||||||||||||||||||||
| 1883 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1884 | - | |||||||||||||||||||||||||||||||||||||
| 1885 | if (QGuiApplication::clipboard()->supportsSelection()
| 0-1042 | ||||||||||||||||||||||||||||||||||||
| 1886 | q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton); executed 1042 times by 5 tests: q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);Executed by:
| 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
| 10-1032 | ||||||||||||||||||||||||||||||||||||
| 1897 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 1898 | , | - | ||||||||||||||||||||||||||||||||||||
| 1899 | 2730 | - | ||||||||||||||||||||||||||||||||||||
| 1900 | )); signalIdx = QClipboard::staticMetaObject.indexOfSignal(signal+1); } executed 10 times by 5 tests: if (methodIdx < 0end of blockExecuted by:
| 10-1032 | ||||||||||||||||||||||||||||||||||||
| 1901 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 1902 | , | - | ||||||||||||||||||||||||||||||||||||
| 1903 | 2730 | - | ||||||||||||||||||||||||||||||||||||
| 1904 | )); if (code == 1
executed 10 times by 5 tests: else methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+1);methodIdx = QQuickTextInput::staticMetaObject.indexOfSlot(method+1);Executed by:
never executed: } ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",methodIdx = QQuickTextInput::staticMetaObject.indexOfSignal(method+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()
| 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 blockExecuted by:
| 1042 | ||||||||||||||||||||||||||||||||||||
| 1921 | - | |||||||||||||||||||||||||||||||||||||
| 1922 | m_inputControl = new QInputControl(QInputControl::LineEdit, q); | - | ||||||||||||||||||||||||||||||||||||
| 1923 | } executed 1042 times by 5 tests: end of blockExecuted by:
| 1042 | ||||||||||||||||||||||||||||||||||||
| 1924 | - | |||||||||||||||||||||||||||||||||||||
| 1925 | void QQuickTextInputPrivate::resetInputMethod() | - | ||||||||||||||||||||||||||||||||||||
| 1926 | { | - | ||||||||||||||||||||||||||||||||||||
| 1927 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1928 | if (!m_readOnly
| 0-182 | ||||||||||||||||||||||||||||||||||||
| 1929 | QGuiApplication::inputMethod()->reset(); executed 182 times by 1 test: QGuiApplication::inputMethod()->reset();Executed by:
| 182 | ||||||||||||||||||||||||||||||||||||
| 1930 | } executed 182 times by 1 test: end of blockExecuted by:
| 182 | ||||||||||||||||||||||||||||||||||||
| 1931 | - | |||||||||||||||||||||||||||||||||||||
| 1932 | void QQuickTextInput::updateCursorRectangle(bool scroll) | - | ||||||||||||||||||||||||||||||||||||
| 1933 | { | - | ||||||||||||||||||||||||||||||||||||
| 1934 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1935 | if (!isComponentComplete()
| 1344-8537 | ||||||||||||||||||||||||||||||||||||
| 1936 | return; executed 1344 times by 4 tests: return;Executed by:
| 1344 | ||||||||||||||||||||||||||||||||||||
| 1937 | - | |||||||||||||||||||||||||||||||||||||
| 1938 | if (scroll
| 4-8533 | ||||||||||||||||||||||||||||||||||||
| 1939 | d->updateHorizontalScroll(); | - | ||||||||||||||||||||||||||||||||||||
| 1940 | d->updateVerticalScroll(); | - | ||||||||||||||||||||||||||||||||||||
| 1941 | } executed 8533 times by 5 tests: end of blockExecuted by:
| 8533 | ||||||||||||||||||||||||||||||||||||
| 1942 | d->updateType = QQuickTextInputPrivate::UpdatePaintNode; | - | ||||||||||||||||||||||||||||||||||||
| 1943 | polish(); | - | ||||||||||||||||||||||||||||||||||||
| 1944 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 1945 | cursorRectangleChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1946 | if (d->cursorItem
| 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 blockExecuted by:
| 954 | ||||||||||||||||||||||||||||||||||||
| 1951 | - | |||||||||||||||||||||||||||||||||||||
| 1952 | updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle); | - | ||||||||||||||||||||||||||||||||||||
| 1953 | - | |||||||||||||||||||||||||||||||||||||
| 1954 | } executed 8537 times by 5 tests: end of blockExecuted by:
| 8537 | ||||||||||||||||||||||||||||||||||||
| 1955 | - | |||||||||||||||||||||||||||||||||||||
| 1956 | void 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()
| 262-740 | ||||||||||||||||||||||||||||||||||||
| 1966 | d->lastSelectionStart = d->selectionStart(); | - | ||||||||||||||||||||||||||||||||||||
| 1967 | if (d->lastSelectionStart == -1
| 320-420 | ||||||||||||||||||||||||||||||||||||
| 1968 | d->lastSelectionStart = d->m_cursor; executed 320 times by 1 test: d->lastSelectionStart = d->m_cursor;Executed by:
| 320 | ||||||||||||||||||||||||||||||||||||
| 1969 | selectionStartChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1970 | } executed 740 times by 1 test: end of blockExecuted by:
| 740 | ||||||||||||||||||||||||||||||||||||
| 1971 | if (d->lastSelectionEnd != d->selectionEnd()
| 220-782 | ||||||||||||||||||||||||||||||||||||
| 1972 | d->lastSelectionEnd = d->selectionEnd(); | - | ||||||||||||||||||||||||||||||||||||
| 1973 | if (d->lastSelectionEnd == -1
| 320-462 | ||||||||||||||||||||||||||||||||||||
| 1974 | d->lastSelectionEnd = d->m_cursor; executed 320 times by 1 test: d->lastSelectionEnd = d->m_cursor;Executed by:
| 320 | ||||||||||||||||||||||||||||||||||||
| 1975 | selectionEndChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 1976 | } executed 782 times by 1 test: end of blockExecuted by:
| 782 | ||||||||||||||||||||||||||||||||||||
| 1977 | } executed 1002 times by 1 test: end of blockExecuted by:
| 1002 | ||||||||||||||||||||||||||||||||||||
| 1978 | - | |||||||||||||||||||||||||||||||||||||
| 1979 | QRectF QQuickTextInput::boundingRect() const | - | ||||||||||||||||||||||||||||||||||||
| 1980 | { | - | ||||||||||||||||||||||||||||||||||||
| 1981 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||||||||||||||
| 1983 | int cursorWidth = d->cursorItem
| 58-92 | ||||||||||||||||||||||||||||||||||||
| 1984 | - | |||||||||||||||||||||||||||||||||||||
| 1985 | qreal hscroll = d->hscroll; | - | ||||||||||||||||||||||||||||||||||||
| 1986 | if (!d->autoScroll
| 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:
| 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: r;return r;Executed by:
executed 150 times by 1 test: return r;Executed by:
| 150 | ||||||||||||||||||||||||||||||||||||
| 1993 | } | - | ||||||||||||||||||||||||||||||||||||
| 1994 | - | |||||||||||||||||||||||||||||||||||||
| 1995 | QRectF QQuickTextInput::clipRect() const | - | ||||||||||||||||||||||||||||||||||||
| 1996 | { | - | ||||||||||||||||||||||||||||||||||||
| 1997 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1998 | - | |||||||||||||||||||||||||||||||||||||
| 1999 | int cursorWidth = d->cursorItem
| 32-40 | ||||||||||||||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||||||||||||||
| 2002 | QRectF r = QQuickImplicitSizeItem::clipRect(); | - | ||||||||||||||||||||||||||||||||||||
| 2003 | r.setRight(r.right() + cursorWidth); | - | ||||||||||||||||||||||||||||||||||||
| 2004 | return executed 72 times by 1 test: r;return r;Executed by:
executed 72 times by 1 test: return r;Executed by:
| 72 | ||||||||||||||||||||||||||||||||||||
| 2005 | } | - | ||||||||||||||||||||||||||||||||||||
| 2006 | - | |||||||||||||||||||||||||||||||||||||
| 2007 | void QQuickTextInput::q_canPasteChanged() | - | ||||||||||||||||||||||||||||||||||||
| 2008 | { | - | ||||||||||||||||||||||||||||||||||||
| 2009 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2010 | bool old = d->canPaste; | - | ||||||||||||||||||||||||||||||||||||
| 2011 | - | |||||||||||||||||||||||||||||||||||||
| 2012 | if (const
| 0-816 | ||||||||||||||||||||||||||||||||||||
| 2013 | d->canPaste = !d->m_readOnly
executed 816 times by 2 tests: d->canPaste = !d->m_readOnly && mimeData->hasText();Executed by:
| 24-816 | ||||||||||||||||||||||||||||||||||||
| 2014 | else | - | ||||||||||||||||||||||||||||||||||||
| 2015 | d->canPaste = false; never executed: d->canPaste = false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2016 | - | |||||||||||||||||||||||||||||||||||||
| 2017 | - | |||||||||||||||||||||||||||||||||||||
| 2018 | bool changed = d->canPaste != old
| 20-518 | ||||||||||||||||||||||||||||||||||||
| 2019 | d->canPasteValid = true; | - | ||||||||||||||||||||||||||||||||||||
| 2020 | if (changed
| 318-498 | ||||||||||||||||||||||||||||||||||||
| 2021 | canPasteChanged(); executed 318 times by 2 tests: canPasteChanged();Executed by:
| 318 | ||||||||||||||||||||||||||||||||||||
| 2022 | - | |||||||||||||||||||||||||||||||||||||
| 2023 | } executed 816 times by 2 tests: end of blockExecuted by:
| 816 | ||||||||||||||||||||||||||||||||||||
| 2024 | - | |||||||||||||||||||||||||||||||||||||
| 2025 | void QQuickTextInput::q_updateAlignment() | - | ||||||||||||||||||||||||||||||||||||
| 2026 | { | - | ||||||||||||||||||||||||||||||||||||
| 2027 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2028 | if (d->determineHorizontalAlignment()
| 12-402 | ||||||||||||||||||||||||||||||||||||
| 2029 | d->updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2030 | updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 2031 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2032 | } executed 414 times by 3 tests: end of blockExecuted by:
| 414 | ||||||||||||||||||||||||||||||||||||
| 2033 | - | |||||||||||||||||||||||||||||||||||||
| 2034 | - | |||||||||||||||||||||||||||||||||||||
| 2035 | - | |||||||||||||||||||||||||||||||||||||
| 2036 | - | |||||||||||||||||||||||||||||||||||||
| 2037 | - | |||||||||||||||||||||||||||||||||||||
| 2038 | - | |||||||||||||||||||||||||||||||||||||
| 2039 | - | |||||||||||||||||||||||||||||||||||||
| 2040 | void QQuickTextInputPrivate::updateDisplayText(bool forceUpdate) | - | ||||||||||||||||||||||||||||||||||||
| 2041 | { | - | ||||||||||||||||||||||||||||||||||||
| 2042 | QString orig = m_textLayout.text(); | - | ||||||||||||||||||||||||||||||||||||
| 2043 | QString str; | - | ||||||||||||||||||||||||||||||||||||
| 2044 | if (m_echoMode == QQuickTextInput::NoEcho
| 6-3708 | ||||||||||||||||||||||||||||||||||||
| 2045 | str = QString::fromLatin1(""); executed 6 times by 1 test: str = QString::fromLatin1("");Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2046 | else | - | ||||||||||||||||||||||||||||||||||||
| 2047 | str = m_text; executed 3708 times by 4 tests: str = m_text;Executed by:
| 3708 | ||||||||||||||||||||||||||||||||||||
| 2048 | - | |||||||||||||||||||||||||||||||||||||
| 2049 | if (m_echoMode == QQuickTextInput::Password
| 32-3682 | ||||||||||||||||||||||||||||||||||||
| 2050 | str.fill(m_passwordCharacter); | - | ||||||||||||||||||||||||||||||||||||
| 2051 | if (m_passwordEchoTimer.isActive()
| 0-32 | ||||||||||||||||||||||||||||||||||||
| 2052 | int cursor = m_cursor - 1; | - | ||||||||||||||||||||||||||||||||||||
| 2053 | QChar uc = m_text.at(cursor); | - | ||||||||||||||||||||||||||||||||||||
| 2054 | str[cursor] = uc; | - | ||||||||||||||||||||||||||||||||||||
| 2055 | if (cursor > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2056 | - | |||||||||||||||||||||||||||||||||||||
| 2057 | - | |||||||||||||||||||||||||||||||||||||
| 2058 | uc = m_text.at(cursor - 1); | - | ||||||||||||||||||||||||||||||||||||
| 2059 | if (uc.unicode() >= 0xd800
| 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: else if (m_echoMode == QQuickTextInput::PasswordEchoOnEditend of blockExecuted by:
| 10-3660 | ||||||||||||||||||||||||||||||||||||
| 2064 | str.fill(m_passwordCharacter); | - | ||||||||||||||||||||||||||||||||||||
| 2065 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2066 | - | |||||||||||||||||||||||||||||||||||||
| 2067 | - | |||||||||||||||||||||||||||||||||||||
| 2068 | - | |||||||||||||||||||||||||||||||||||||
| 2069 | - | |||||||||||||||||||||||||||||||||||||
| 2070 | QChar* uc = str.data(); | - | ||||||||||||||||||||||||||||||||||||
| 2071 | for (int i = 0; i < str.length()
| 3714-48304 | ||||||||||||||||||||||||||||||||||||
| 2072 | if ((uc[i].unicode() < 0x20
| 0-48298 | ||||||||||||||||||||||||||||||||||||
| 2073 | || uc[i] == QChar::LineSeparator
| 0-48298 | ||||||||||||||||||||||||||||||||||||
| 2074 | || uc[i] == QChar::ParagraphSeparator
| 0-48298 | ||||||||||||||||||||||||||||||||||||
| 2075 | || uc[i] == QChar::ObjectReplacementCharacter
| 0-48298 | ||||||||||||||||||||||||||||||||||||
| 2076 | uc[i] = QChar(0x0020); executed 6 times by 2 tests: uc[i] = QChar(0x0020);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2077 | } executed 48304 times by 4 tests: end of blockExecuted by:
| 48304 | ||||||||||||||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||||||||||||||
| 2079 | if (str != orig
| 92-3184 | ||||||||||||||||||||||||||||||||||||
| 2080 | m_textLayout.setText(str); | - | ||||||||||||||||||||||||||||||||||||
| 2081 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2082 | q_func()->displayTextChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2083 | } executed 3276 times by 4 tests: end of blockExecuted by:
| 3276 | ||||||||||||||||||||||||||||||||||||
| 2084 | } executed 3714 times by 4 tests: end of blockExecuted by:
| 3714 | ||||||||||||||||||||||||||||||||||||
| 2085 | - | |||||||||||||||||||||||||||||||||||||
| 2086 | qreal QQuickTextInputPrivate::getImplicitWidth() const | - | ||||||||||||||||||||||||||||||||||||
| 2087 | { | - | ||||||||||||||||||||||||||||||||||||
| 2088 | const QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2089 | if (!requireImplicitWidth
| 14-38 | ||||||||||||||||||||||||||||||||||||
| 2090 | QQuickTextInputPrivate *d = const_cast<QQuickTextInputPrivate *>(this); | - | ||||||||||||||||||||||||||||||||||||
| 2091 | d->requireImplicitWidth = true; | - | ||||||||||||||||||||||||||||||||||||
| 2092 | - | |||||||||||||||||||||||||||||||||||||
| 2093 | if (q->isComponentComplete()
| 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 blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2116 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 2117 | return executed 52 times by 1 test: implicitWidth;return implicitWidth;Executed by:
executed 52 times by 1 test: return implicitWidth;Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||
| 2118 | } | - | ||||||||||||||||||||||||||||||||||||
| 2119 | - | |||||||||||||||||||||||||||||||||||||
| 2120 | void QQuickTextInputPrivate::setTopPadding(qreal value, bool reset) | - | ||||||||||||||||||||||||||||||||||||
| 2121 | { | - | ||||||||||||||||||||||||||||||||||||
| 2122 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2123 | qreal oldPadding = q->topPadding(); | - | ||||||||||||||||||||||||||||||||||||
| 2124 | if (!reset
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 2125 | extra.value().topPadding = value; | - | ||||||||||||||||||||||||||||||||||||
| 2126 | extra.value().explicitTopPadding = !reset; | - | ||||||||||||||||||||||||||||||||||||
| 2127 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2128 | if ((!reset
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 2129 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2130 | q->topPaddingChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2131 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2132 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2133 | - | |||||||||||||||||||||||||||||||||||||
| 2134 | void QQuickTextInputPrivate::setLeftPadding(qreal value, bool reset) | - | ||||||||||||||||||||||||||||||||||||
| 2135 | { | - | ||||||||||||||||||||||||||||||||||||
| 2136 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2137 | qreal oldPadding = q->leftPadding(); | - | ||||||||||||||||||||||||||||||||||||
| 2138 | if (!reset
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 2139 | extra.value().leftPadding = value; | - | ||||||||||||||||||||||||||||||||||||
| 2140 | extra.value().explicitLeftPadding = !reset; | - | ||||||||||||||||||||||||||||||||||||
| 2141 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2142 | if ((!reset
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 2143 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2144 | q->leftPaddingChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2145 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2146 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2147 | - | |||||||||||||||||||||||||||||||||||||
| 2148 | void QQuickTextInputPrivate::setRightPadding(qreal value, bool reset) | - | ||||||||||||||||||||||||||||||||||||
| 2149 | { | - | ||||||||||||||||||||||||||||||||||||
| 2150 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2151 | qreal oldPadding = q->rightPadding(); | - | ||||||||||||||||||||||||||||||||||||
| 2152 | if (!reset
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 2153 | extra.value().rightPadding = value; | - | ||||||||||||||||||||||||||||||||||||
| 2154 | extra.value().explicitRightPadding = !reset; | - | ||||||||||||||||||||||||||||||||||||
| 2155 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2156 | if ((!reset
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 2157 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2158 | q->rightPaddingChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2159 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2160 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||||||||||||||
| 2162 | void QQuickTextInputPrivate::setBottomPadding(qreal value, bool reset) | - | ||||||||||||||||||||||||||||||||||||
| 2163 | { | - | ||||||||||||||||||||||||||||||||||||
| 2164 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2165 | qreal oldPadding = q->bottomPadding(); | - | ||||||||||||||||||||||||||||||||||||
| 2166 | if (!reset
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 2167 | extra.value().bottomPadding = value; | - | ||||||||||||||||||||||||||||||||||||
| 2168 | extra.value().explicitBottomPadding = !reset; | - | ||||||||||||||||||||||||||||||||||||
| 2169 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2170 | if ((!reset
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 2171 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2172 | q->bottomPaddingChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2173 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2174 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2175 | - | |||||||||||||||||||||||||||||||||||||
| 2176 | bool QQuickTextInputPrivate::isImplicitResizeEnabled() const | - | ||||||||||||||||||||||||||||||||||||
| 2177 | { | - | ||||||||||||||||||||||||||||||||||||
| 2178 | return executed 11336 times by 5 tests: !extra.isAllocated() || extra->implicitResize;return !extra.isAllocated() || extra->implicitResize;Executed by:
executed 11336 times by 5 tests: return !extra.isAllocated() || extra->implicitResize;Executed by:
| 11336 | ||||||||||||||||||||||||||||||||||||
| 2179 | } | - | ||||||||||||||||||||||||||||||||||||
| 2180 | - | |||||||||||||||||||||||||||||||||||||
| 2181 | void QQuickTextInputPrivate::setImplicitResizeEnabled(bool enabled) | - | ||||||||||||||||||||||||||||||||||||
| 2182 | { | - | ||||||||||||||||||||||||||||||||||||
| 2183 | if (!enabled
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 2184 | extra.value().implicitResize = false; executed 6 times by 1 test: extra.value().implicitResize = false;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2185 | else if (extra.isAllocated()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2186 | extra->implicitResize = true; never executed: extra->implicitResize = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2187 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2188 | - | |||||||||||||||||||||||||||||||||||||
| 2189 | void QQuickTextInputPrivate::updateLayout() | - | ||||||||||||||||||||||||||||||||||||
| 2190 | { | - | ||||||||||||||||||||||||||||||||||||
| 2191 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2192 | - | |||||||||||||||||||||||||||||||||||||
| 2193 | if (!q->isComponentComplete()
| 1068-6090 | ||||||||||||||||||||||||||||||||||||
| 2194 | return; executed 1068 times by 4 tests: return;Executed by:
| 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()
| 0-6090 | ||||||||||||||||||||||||||||||||||||
| 2202 | option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering); executed 6090 times by 5 tests: option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);Executed by:
| 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
| 62-6028 | ||||||||||||||||||||||||||||||||||||
| 2211 | line.setLineWidth(0x7fffffff); | - | ||||||||||||||||||||||||||||||||||||
| 2212 | const bool wasInLayout = inLayout; | - | ||||||||||||||||||||||||||||||||||||
| 2213 | inLayout = true; | - | ||||||||||||||||||||||||||||||||||||
| 2214 | if (isImplicitResizeEnabled()
| 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:
| 62 | ||||||||||||||||||||||||||||||||||||
| 2216 | inLayout = wasInLayout; | - | ||||||||||||||||||||||||||||||||||||
| 2217 | if (inLayout
| 0-62 | ||||||||||||||||||||||||||||||||||||
| 2218 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2219 | } executed 62 times by 1 test: end of blockExecuted by:
| 62 | ||||||||||||||||||||||||||||||||||||
| 2220 | qreal lineWidth = q->widthValid()
| 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: while (line.isValid()end of blockExecuted by:
| 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()
| 16-6074 | ||||||||||||||||||||||||||||||||||||
| 2247 | if (!requireImplicitWidth
| 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:
| 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:
| 912 | ||||||||||||||||||||||||||||||||||||
| 2251 | } | - | ||||||||||||||||||||||||||||||||||||
| 2252 | - | |||||||||||||||||||||||||||||||||||||
| 2253 | updateBaselineOffset(); | - | ||||||||||||||||||||||||||||||||||||
| 2254 | - | |||||||||||||||||||||||||||||||||||||
| 2255 | if (previousSize != contentSize
| 2836-3254 | ||||||||||||||||||||||||||||||||||||
| 2256 | q->contentSizeChanged(); executed 3254 times by 5 tests: q->contentSizeChanged();Executed by:
| 3254 | ||||||||||||||||||||||||||||||||||||
| 2257 | } executed 6090 times by 5 tests: end of blockExecuted by:
| 6090 | ||||||||||||||||||||||||||||||||||||
| 2258 | - | |||||||||||||||||||||||||||||||||||||
| 2259 | - | |||||||||||||||||||||||||||||||||||||
| 2260 | - | |||||||||||||||||||||||||||||||||||||
| 2261 | - | |||||||||||||||||||||||||||||||||||||
| 2262 | - | |||||||||||||||||||||||||||||||||||||
| 2263 | - | |||||||||||||||||||||||||||||||||||||
| 2264 | - | |||||||||||||||||||||||||||||||||||||
| 2265 | void QQuickTextInputPrivate::updateBaselineOffset() | - | ||||||||||||||||||||||||||||||||||||
| 2266 | { | - | ||||||||||||||||||||||||||||||||||||
| 2267 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2268 | if (!q->isComponentComplete()
| 12-6106 | ||||||||||||||||||||||||||||||||||||
| 2269 | return; executed 12 times by 1 test: return;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2270 | QFontMetricsF fm(font); | - | ||||||||||||||||||||||||||||||||||||
| 2271 | qreal yoff = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2272 | if (q->heightValid()
| 772-5334 | ||||||||||||||||||||||||||||||||||||
| 2273 | const qreal surplusHeight = q->height() - contentSize.height() - q->topPadding() - q->bottomPadding(); | - | ||||||||||||||||||||||||||||||||||||
| 2274 | if (vAlign == QQuickTextInput::AlignBottom
| 58-714 | ||||||||||||||||||||||||||||||||||||
| 2275 | yoff = surplusHeight; executed 58 times by 1 test: yoff = surplusHeight;Executed by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 2276 | else if (vAlign == QQuickTextInput::AlignVCenter
| 42-672 | ||||||||||||||||||||||||||||||||||||
| 2277 | yoff = surplusHeight/2; executed 42 times by 1 test: yoff = surplusHeight/2;Executed by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 2278 | } executed 772 times by 3 tests: end of blockExecuted by:
| 772 | ||||||||||||||||||||||||||||||||||||
| 2279 | q->setBaselineOffset(fm.ascent() + yoff + q->topPadding()); | - | ||||||||||||||||||||||||||||||||||||
| 2280 | } executed 6106 times by 5 tests: end of blockExecuted by:
| 6106 | ||||||||||||||||||||||||||||||||||||
| 2281 | void QQuickTextInputPrivate::copy(QClipboard::Mode mode) const | - | ||||||||||||||||||||||||||||||||||||
| 2282 | { | - | ||||||||||||||||||||||||||||||||||||
| 2283 | QString t = selectedText(); | - | ||||||||||||||||||||||||||||||||||||
| 2284 | if (!t.isEmpty()
| 12-76 | ||||||||||||||||||||||||||||||||||||
| 2285 | QGuiApplication::clipboard()->setText(t, mode); | - | ||||||||||||||||||||||||||||||||||||
| 2286 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||||||||||||||
| 2287 | } executed 118 times by 1 test: end of blockExecuted by:
| 118 | ||||||||||||||||||||||||||||||||||||
| 2288 | void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode) | - | ||||||||||||||||||||||||||||||||||||
| 2289 | { | - | ||||||||||||||||||||||||||||||||||||
| 2290 | QString clip = QGuiApplication::clipboard()->text(clipboardMode); | - | ||||||||||||||||||||||||||||||||||||
| 2291 | if (!clip.isEmpty()
| 0-14 | ||||||||||||||||||||||||||||||||||||
| 2292 | separate(); | - | ||||||||||||||||||||||||||||||||||||
| 2293 | insert(clip); | - | ||||||||||||||||||||||||||||||||||||
| 2294 | separate(); | - | ||||||||||||||||||||||||||||||||||||
| 2295 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 2296 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 2297 | - | |||||||||||||||||||||||||||||||||||||
| 2298 | - | |||||||||||||||||||||||||||||||||||||
| 2299 | - | |||||||||||||||||||||||||||||||||||||
| 2300 | - | |||||||||||||||||||||||||||||||||||||
| 2301 | - | |||||||||||||||||||||||||||||||||||||
| 2302 | - | |||||||||||||||||||||||||||||||||||||
| 2303 | - | |||||||||||||||||||||||||||||||||||||
| 2304 | void QQuickTextInputPrivate::commitPreedit() | - | ||||||||||||||||||||||||||||||||||||
| 2305 | { | - | ||||||||||||||||||||||||||||||||||||
| 2306 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2307 | - | |||||||||||||||||||||||||||||||||||||
| 2308 | if (!hasImState
| 0-2278 | ||||||||||||||||||||||||||||||||||||
| 2309 | return; executed 2278 times by 2 tests: return;Executed by:
| 2278 | ||||||||||||||||||||||||||||||||||||
| 2310 | - | |||||||||||||||||||||||||||||||||||||
| 2311 | QGuiApplication::inputMethod()->commit(); | - | ||||||||||||||||||||||||||||||||||||
| 2312 | - | |||||||||||||||||||||||||||||||||||||
| 2313 | if (!hasImState
| 0 | ||||||||||||||||||||||||||||||||||||
| 2314 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2315 | - | |||||||||||||||||||||||||||||||||||||
| 2316 | QInputMethodEvent ev; | - | ||||||||||||||||||||||||||||||||||||
| 2317 | QCoreApplication::sendEvent(q, &ev); | - | ||||||||||||||||||||||||||||||||||||
| 2318 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2319 | - | |||||||||||||||||||||||||||||||||||||
| 2320 | void QQuickTextInputPrivate::cancelPreedit() | - | ||||||||||||||||||||||||||||||||||||
| 2321 | { | - | ||||||||||||||||||||||||||||||||||||
| 2322 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2323 | - | |||||||||||||||||||||||||||||||||||||
| 2324 | if (!hasImState
| 2-1242 | ||||||||||||||||||||||||||||||||||||
| 2325 | return; executed 1242 times by 4 tests: return;Executed by:
| 1242 | ||||||||||||||||||||||||||||||||||||
| 2326 | - | |||||||||||||||||||||||||||||||||||||
| 2327 | QGuiApplication::inputMethod()->reset(); | - | ||||||||||||||||||||||||||||||||||||
| 2328 | - | |||||||||||||||||||||||||||||||||||||
| 2329 | QInputMethodEvent ev; | - | ||||||||||||||||||||||||||||||||||||
| 2330 | QCoreApplication::sendEvent(q, &ev); | - | ||||||||||||||||||||||||||||||||||||
| 2331 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2332 | void QQuickTextInputPrivate::backspace() | - | ||||||||||||||||||||||||||||||||||||
| 2333 | { | - | ||||||||||||||||||||||||||||||||||||
| 2334 | int priorState = m_undoState; | - | ||||||||||||||||||||||||||||||||||||
| 2335 | if (separateSelection()
| 4-56 | ||||||||||||||||||||||||||||||||||||
| 2336 | removeSelectedText(); | - | ||||||||||||||||||||||||||||||||||||
| 2337 | } executed 4 times by 1 test: else if (m_cursorend of blockExecuted by:
| 2-54 | ||||||||||||||||||||||||||||||||||||
| 2338 | --m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2339 | if (m_maskData
| 16-38 | ||||||||||||||||||||||||||||||||||||
| 2340 | m_cursor = prevMaskBlank(m_cursor); executed 16 times by 1 test: m_cursor = prevMaskBlank(m_cursor);Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2341 | QChar uc = m_text.at(m_cursor); | - | ||||||||||||||||||||||||||||||||||||
| 2342 | if (m_cursor > 0
| 0-52 | ||||||||||||||||||||||||||||||||||||
| 2343 | - | |||||||||||||||||||||||||||||||||||||
| 2344 | - | |||||||||||||||||||||||||||||||||||||
| 2345 | uc = m_text.at(m_cursor - 1); | - | ||||||||||||||||||||||||||||||||||||
| 2346 | if (uc.unicode() >= 0xd800
| 0-10 | ||||||||||||||||||||||||||||||||||||
| 2347 | internalDelete(true); | - | ||||||||||||||||||||||||||||||||||||
| 2348 | --m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2349 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2350 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2351 | internalDelete(true); | - | ||||||||||||||||||||||||||||||||||||
| 2352 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||||||||||||||
| 2353 | finishChange(priorState); | - | ||||||||||||||||||||||||||||||||||||
| 2354 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||||||||||||||||||||||||||||||||
| 2355 | void QQuickTextInputPrivate::del() | - | ||||||||||||||||||||||||||||||||||||
| 2356 | { | - | ||||||||||||||||||||||||||||||||||||
| 2357 | int priorState = m_undoState; | - | ||||||||||||||||||||||||||||||||||||
| 2358 | if (separateSelection()
| 14-28 | ||||||||||||||||||||||||||||||||||||
| 2359 | removeSelectedText(); | - | ||||||||||||||||||||||||||||||||||||
| 2360 | } executed 14 times by 1 test: else {end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 2361 | int n = m_textLayout.nextCursorPosition(m_cursor) - m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2362 | while (n--
| 28-36 | ||||||||||||||||||||||||||||||||||||
| 2363 | internalDelete(); executed 36 times by 1 test: internalDelete();Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 2364 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 2365 | finishChange(priorState); | - | ||||||||||||||||||||||||||||||||||||
| 2366 | } executed 42 times by 1 test: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 2367 | void QQuickTextInputPrivate::insert(const QString &newText) | - | ||||||||||||||||||||||||||||||||||||
| 2368 | { | - | ||||||||||||||||||||||||||||||||||||
| 2369 | int priorState = m_undoState; | - | ||||||||||||||||||||||||||||||||||||
| 2370 | if (separateSelection()
| 16-1360 | ||||||||||||||||||||||||||||||||||||
| 2371 | removeSelectedText(); executed 16 times by 1 test: removeSelectedText();Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2372 | internalInsert(newText); | - | ||||||||||||||||||||||||||||||||||||
| 2373 | finishChange(priorState); | - | ||||||||||||||||||||||||||||||||||||
| 2374 | } executed 1376 times by 1 test: end of blockExecuted by:
| 1376 | ||||||||||||||||||||||||||||||||||||
| 2375 | - | |||||||||||||||||||||||||||||||||||||
| 2376 | - | |||||||||||||||||||||||||||||||||||||
| 2377 | - | |||||||||||||||||||||||||||||||||||||
| 2378 | - | |||||||||||||||||||||||||||||||||||||
| 2379 | - | |||||||||||||||||||||||||||||||||||||
| 2380 | - | |||||||||||||||||||||||||||||||||||||
| 2381 | void 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 blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 2391 | void QQuickTextInputPrivate::setSelection(int start, int length) | - | ||||||||||||||||||||||||||||||||||||
| 2392 | { | - | ||||||||||||||||||||||||||||||||||||
| 2393 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2394 | - | |||||||||||||||||||||||||||||||||||||
| 2395 | commitPreedit(); | - | ||||||||||||||||||||||||||||||||||||
| 2396 | - | |||||||||||||||||||||||||||||||||||||
| 2397 | - | |||||||||||||||||||||||||||||||||||||
| 2398 | if (start < 0
| 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
| 288-392 | ||||||||||||||||||||||||||||||||||||
| 2404 | if (start == m_selstart
| 0-200 | ||||||||||||||||||||||||||||||||||||
| 2405 | return; executed 20 times by 1 test: return;Executed by:
| 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: else if (length < 0end of blockExecuted by:
| 144-372 | ||||||||||||||||||||||||||||||||||||
| 2410 | if (start == m_selend
| 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: else if (m_selstart != m_selendend of blockExecuted by:
| 6-144 | ||||||||||||||||||||||||||||||||||||
| 2416 | m_selstart = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2417 | m_selend = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2418 | m_cursor = start; | - | ||||||||||||||||||||||||||||||||||||
| 2419 | } executed 6 times by 1 test: else {end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2420 | m_cursor = start; | - | ||||||||||||||||||||||||||||||||||||
| 2421 | emitCursorPositionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2422 | return; executed 138 times by 1 test: return;Executed by:
| 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 blockExecuted by:
| 522 | ||||||||||||||||||||||||||||||||||||
| 2431 | void QQuickTextInputPrivate::updatePasswordEchoEditing(bool editing) | - | ||||||||||||||||||||||||||||||||||||
| 2432 | { | - | ||||||||||||||||||||||||||||||||||||
| 2433 | cancelPasswordEchoTimer(); | - | ||||||||||||||||||||||||||||||||||||
| 2434 | m_passwordEchoEditing = editing; | - | ||||||||||||||||||||||||||||||||||||
| 2435 | updateDisplayText(); | - | ||||||||||||||||||||||||||||||||||||
| 2436 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 2437 | bool QQuickTextInputPrivate::fixup() | - | ||||||||||||||||||||||||||||||||||||
| 2438 | { | - | ||||||||||||||||||||||||||||||||||||
| 2439 | - | |||||||||||||||||||||||||||||||||||||
| 2440 | if (m_validator
| 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
| 4 | ||||||||||||||||||||||||||||||||||||
| 2445 | if (textCopy != m_text
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 2446 | internalSetText(textCopy, cursorCopy); executed 4 times by 1 test: internalSetText(textCopy, cursorCopy);Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 2447 | return executed 4 times by 1 test: true;return true;Executed by:
executed 4 times by 1 test: return true;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 2448 | } | - | ||||||||||||||||||||||||||||||||||||
| 2449 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 2450 | - | |||||||||||||||||||||||||||||||||||||
| 2451 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 2452 | } | - | ||||||||||||||||||||||||||||||||||||
| 2453 | - | |||||||||||||||||||||||||||||||||||||
| 2454 | - | |||||||||||||||||||||||||||||||||||||
| 2455 | - | |||||||||||||||||||||||||||||||||||||
| 2456 | - | |||||||||||||||||||||||||||||||||||||
| 2457 | - | |||||||||||||||||||||||||||||||||||||
| 2458 | - | |||||||||||||||||||||||||||||||||||||
| 2459 | - | |||||||||||||||||||||||||||||||||||||
| 2460 | void QQuickTextInputPrivate::moveCursor(int pos, bool mark) | - | ||||||||||||||||||||||||||||||||||||
| 2461 | { | - | ||||||||||||||||||||||||||||||||||||
| 2462 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2463 | - | |||||||||||||||||||||||||||||||||||||
| 2464 | commitPreedit(); | - | ||||||||||||||||||||||||||||||||||||
| 2465 | - | |||||||||||||||||||||||||||||||||||||
| 2466 | - | |||||||||||||||||||||||||||||||||||||
| 2467 | if (pos != m_cursor
| 222-1370 | ||||||||||||||||||||||||||||||||||||
| 2468 | separate(); | - | ||||||||||||||||||||||||||||||||||||
| 2469 | if (m_maskData
| 264-1106 | ||||||||||||||||||||||||||||||||||||
| 2470 | pos = pos > m_cursor
executed 264 times by 1 test: pos = pos > m_cursor ? nextMaskBlank(pos) : prevMaskBlank(pos);Executed by:
| 4-264 | ||||||||||||||||||||||||||||||||||||
| 2471 | } executed 1370 times by 1 test: end of blockExecuted by:
| 1370 | ||||||||||||||||||||||||||||||||||||
| 2472 | if (mark
| 160-1432 | ||||||||||||||||||||||||||||||||||||
| 2473 | int anchor; | - | ||||||||||||||||||||||||||||||||||||
| 2474 | if (m_selend > m_selstart
| 10-138 | ||||||||||||||||||||||||||||||||||||
| 2475 | anchor = m_selend; executed 10 times by 1 test: anchor = m_selend;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2476 | else if (m_selend > m_selstart
| 0-138 | ||||||||||||||||||||||||||||||||||||
| 2477 | anchor = m_selstart; executed 12 times by 1 test: anchor = m_selstart;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2478 | else | - | ||||||||||||||||||||||||||||||||||||
| 2479 | anchor = m_cursor; executed 138 times by 1 test: anchor = m_cursor;Executed by:
| 138 | ||||||||||||||||||||||||||||||||||||
| 2480 | m_selstart = qMin(anchor, pos); | - | ||||||||||||||||||||||||||||||||||||
| 2481 | m_selend = qMax(anchor, pos); | - | ||||||||||||||||||||||||||||||||||||
| 2482 | } executed 160 times by 1 test: else {end of blockExecuted by:
| 160 | ||||||||||||||||||||||||||||||||||||
| 2483 | internalDeselect(); | - | ||||||||||||||||||||||||||||||||||||
| 2484 | } executed 1432 times by 2 tests: end of blockExecuted by:
| 1432 | ||||||||||||||||||||||||||||||||||||
| 2485 | m_cursor = pos; | - | ||||||||||||||||||||||||||||||||||||
| 2486 | if (mark
| 84-1432 | ||||||||||||||||||||||||||||||||||||
| 2487 | m_selDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 2488 | q->selectionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2489 | } executed 244 times by 1 test: end of blockExecuted by:
| 244 | ||||||||||||||||||||||||||||||||||||
| 2490 | emitCursorPositionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2491 | - | |||||||||||||||||||||||||||||||||||||
| 2492 | q->updateInputMethod(); | - | ||||||||||||||||||||||||||||||||||||
| 2493 | - | |||||||||||||||||||||||||||||||||||||
| 2494 | } executed 1592 times by 2 tests: end of blockExecuted by:
| 1592 | ||||||||||||||||||||||||||||||||||||
| 2495 | void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 2496 | { | - | ||||||||||||||||||||||||||||||||||||
| 2497 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2498 | - | |||||||||||||||||||||||||||||||||||||
| 2499 | int priorState = -1; | - | ||||||||||||||||||||||||||||||||||||
| 2500 | bool isGettingInput = !event->commitString().isEmpty()
| 148-200 | ||||||||||||||||||||||||||||||||||||
| 2501 | || event->preeditString() != preeditAreaText()
| 46-154 | ||||||||||||||||||||||||||||||||||||
| 2502 | || event->replacementLength() > 0
| 46-108 | ||||||||||||||||||||||||||||||||||||
| 2503 | bool cursorPositionChanged = false; | - | ||||||||||||||||||||||||||||||||||||
| 2504 | bool selectionChange = false; | - | ||||||||||||||||||||||||||||||||||||
| 2505 | m_preeditDirty = event->preeditString() != preeditAreaText(); | - | ||||||||||||||||||||||||||||||||||||
| 2506 | - | |||||||||||||||||||||||||||||||||||||
| 2507 | if (isGettingInput
| 46-302 | ||||||||||||||||||||||||||||||||||||
| 2508 | - | |||||||||||||||||||||||||||||||||||||
| 2509 | priorState = m_undoState; | - | ||||||||||||||||||||||||||||||||||||
| 2510 | separateSelection(); | - | ||||||||||||||||||||||||||||||||||||
| 2511 | if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
| 0-300 | ||||||||||||||||||||||||||||||||||||
| 2512 | updatePasswordEchoEditing(true); | - | ||||||||||||||||||||||||||||||||||||
| 2513 | m_selstart = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2514 | m_selend = m_text.length(); | - | ||||||||||||||||||||||||||||||||||||
| 2515 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2516 | removeSelectedText(); | - | ||||||||||||||||||||||||||||||||||||
| 2517 | } executed 302 times by 1 test: end of blockExecuted by:
| 302 | ||||||||||||||||||||||||||||||||||||
| 2518 | - | |||||||||||||||||||||||||||||||||||||
| 2519 | int c = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2520 | if (event->replacementStart() <= 0
| 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:
| 348 | ||||||||||||||||||||||||||||||||||||
| 2522 | - | |||||||||||||||||||||||||||||||||||||
| 2523 | m_cursor += event->replacementStart(); | - | ||||||||||||||||||||||||||||||||||||
| 2524 | if (m_cursor < 0
| 2-346 | ||||||||||||||||||||||||||||||||||||
| 2525 | m_cursor = 0; executed 2 times by 1 test: m_cursor = 0;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2526 | - | |||||||||||||||||||||||||||||||||||||
| 2527 | - | |||||||||||||||||||||||||||||||||||||
| 2528 | if (event->replacementLength()
| 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 blockExecuted by:
| 124 | ||||||||||||||||||||||||||||||||||||
| 2534 | if (!event->commitString().isEmpty()
| 148-200 | ||||||||||||||||||||||||||||||||||||
| 2535 | internalInsert(event->commitString()); | - | ||||||||||||||||||||||||||||||||||||
| 2536 | cursorPositionChanged = true; | - | ||||||||||||||||||||||||||||||||||||
| 2537 | } executed 148 times by 1 test: else {end of blockExecuted by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 2538 | m_cursor = qBound(0, c, m_text.length()); | - | ||||||||||||||||||||||||||||||||||||
| 2539 | } executed 200 times by 1 test: end of blockExecuted by:
| 200 | ||||||||||||||||||||||||||||||||||||
| 2540 | - | |||||||||||||||||||||||||||||||||||||
| 2541 | for (int i = 0; i < event->attributes().size()
| 54-348 | ||||||||||||||||||||||||||||||||||||
| 2542 | const QInputMethodEvent::Attribute &a = event->attributes().at(i); | - | ||||||||||||||||||||||||||||||||||||
| 2543 | if (a.type == QInputMethodEvent::Selection
| 6-48 | ||||||||||||||||||||||||||||||||||||
| 2544 | m_cursor = qBound(0, a.start + a.length, m_text.length()); | - | ||||||||||||||||||||||||||||||||||||
| 2545 | if (a.length
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 2546 | m_selstart = qMax(0, qMin(a.start, m_text.length())); | - | ||||||||||||||||||||||||||||||||||||
| 2547 | m_selend = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2548 | if (m_selend < m_selstart
| 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: else {end of blockExecuted by:
| 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 blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2557 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||||||||||||||
| 2558 | QString oldPreeditString = m_textLayout.preeditAreaText(); | - | ||||||||||||||||||||||||||||||||||||
| 2559 | m_textLayout.setPreeditArea(m_cursor, event->preeditString()); | - | ||||||||||||||||||||||||||||||||||||
| 2560 | if (oldPreeditString != m_textLayout.preeditAreaText()
| 46-302 | ||||||||||||||||||||||||||||||||||||
| 2561 | q->preeditTextChanged(); executed 46 times by 1 test: q->preeditTextChanged();Executed by:
| 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()
| 54-348 | ||||||||||||||||||||||||||||||||||||
| 2568 | const QInputMethodEvent::Attribute &a = event->attributes().at(i); | - | ||||||||||||||||||||||||||||||||||||
| 2569 | if (a.type == QInputMethodEvent::Cursor
| 8-46 | ||||||||||||||||||||||||||||||||||||
| 2570 | hasImState = true; | - | ||||||||||||||||||||||||||||||||||||
| 2571 | m_preeditCursor = a.start; | - | ||||||||||||||||||||||||||||||||||||
| 2572 | cursorVisible = a.length != 0; | - | ||||||||||||||||||||||||||||||||||||
| 2573 | } executed 46 times by 1 test: else if (a.type == QInputMethodEvent::TextFormatend of blockExecuted by:
| 2-46 | ||||||||||||||||||||||||||||||||||||
| 2574 | hasImState = true; | - | ||||||||||||||||||||||||||||||||||||
| 2575 | QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat(); | - | ||||||||||||||||||||||||||||||||||||
| 2576 | if (f.isValid()
| 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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2583 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2584 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||||||||||||||
| 2585 | m_textLayout.setFormats(formats); | - | ||||||||||||||||||||||||||||||||||||
| 2586 | - | |||||||||||||||||||||||||||||||||||||
| 2587 | updateDisplayText( true); | - | ||||||||||||||||||||||||||||||||||||
| 2588 | if ((cursorPositionChanged
| 8-194 | ||||||||||||||||||||||||||||||||||||
| 2589 | || m_preeditCursor != oldPreeditCursor
| 74-266 | ||||||||||||||||||||||||||||||||||||
| 2590 | || isGettingInput
| 12-254 | ||||||||||||||||||||||||||||||||||||
| 2591 | q->updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 2592 | } executed 336 times by 1 test: end of blockExecuted by:
| 336 | ||||||||||||||||||||||||||||||||||||
| 2593 | - | |||||||||||||||||||||||||||||||||||||
| 2594 | if (isGettingInput
| 46-302 | ||||||||||||||||||||||||||||||||||||
| 2595 | finishChange(priorState); executed 302 times by 1 test: finishChange(priorState);Executed by:
| 302 | ||||||||||||||||||||||||||||||||||||
| 2596 | - | |||||||||||||||||||||||||||||||||||||
| 2597 | q->setCursorVisible(cursorVisible); | - | ||||||||||||||||||||||||||||||||||||
| 2598 | - | |||||||||||||||||||||||||||||||||||||
| 2599 | if (selectionChange
| 6-342 | ||||||||||||||||||||||||||||||||||||
| 2600 | q->selectionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2601 | q->updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | - | ||||||||||||||||||||||||||||||||||||
| 2602 | | Qt::ImCurrentSelection); | - | ||||||||||||||||||||||||||||||||||||
| 2603 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2604 | } executed 348 times by 1 test: end of blockExecuted by:
| 348 | ||||||||||||||||||||||||||||||||||||
| 2605 | void QQuickTextInputPrivate::selectWordAtPos(int cursor) | - | ||||||||||||||||||||||||||||||||||||
| 2606 | { | - | ||||||||||||||||||||||||||||||||||||
| 2607 | int next = cursor + 1; | - | ||||||||||||||||||||||||||||||||||||
| 2608 | if (next > end()
| 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
| 0-20 | ||||||||||||||||||||||||||||||||||||
| 2615 | -- executed 10 times by 1 test: end;--end;Executed by:
executed 10 times by 1 test: --end;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2616 | moveCursor(end, true); | - | ||||||||||||||||||||||||||||||||||||
| 2617 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2618 | bool 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
| 10-3266 | ||||||||||||||||||||||||||||||||||||
| 2625 | - | |||||||||||||||||||||||||||||||||||||
| 2626 | bool alignmentChanged = false; | - | ||||||||||||||||||||||||||||||||||||
| 2627 | bool textChanged = false; | - | ||||||||||||||||||||||||||||||||||||
| 2628 | - | |||||||||||||||||||||||||||||||||||||
| 2629 | if (m_textDirty
| 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
| 148-3118 | ||||||||||||||||||||||||||||||||||||
| 2637 | QString textCopy = m_text; | - | ||||||||||||||||||||||||||||||||||||
| 2638 | if (m_maskData
| 56-92 | ||||||||||||||||||||||||||||||||||||
| 2639 | textCopy = maskString(0, m_text, true); executed 56 times by 1 test: textCopy = maskString(0, m_text, true);Executed by:
| 56 | ||||||||||||||||||||||||||||||||||||
| 2640 | int cursorCopy = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 2641 | QValidator::State state = m_validator->validate(textCopy, cursorCopy); | - | ||||||||||||||||||||||||||||||||||||
| 2642 | if (m_maskData
| 56-92 | ||||||||||||||||||||||||||||||||||||
| 2643 | textCopy = m_text; executed 56 times by 1 test: textCopy = m_text;Executed by:
| 56 | ||||||||||||||||||||||||||||||||||||
| 2644 | m_validInput = state != QValidator::Invalid; | - | ||||||||||||||||||||||||||||||||||||
| 2645 | m_acceptableInput = state == QValidator::Acceptable; | - | ||||||||||||||||||||||||||||||||||||
| 2646 | if (m_validInput
| 28-120 | ||||||||||||||||||||||||||||||||||||
| 2647 | if (m_text != textCopy
| 0-72 | ||||||||||||||||||||||||||||||||||||
| 2648 | internalSetText(textCopy, cursorCopy); | - | ||||||||||||||||||||||||||||||||||||
| 2649 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2650 | } | - | ||||||||||||||||||||||||||||||||||||
| 2651 | m_cursor = cursorCopy; | - | ||||||||||||||||||||||||||||||||||||
| 2652 | } executed 72 times by 1 test: end of blockExecuted by:
| 72 | ||||||||||||||||||||||||||||||||||||
| 2653 | } executed 148 times by 1 test: end of blockExecuted by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 2654 | - | |||||||||||||||||||||||||||||||||||||
| 2655 | if (m_maskData
| 1054-2212 | ||||||||||||||||||||||||||||||||||||
| 2656 | checkIsValid(); executed 1054 times by 1 test: checkIsValid();Executed by:
| 1054 | ||||||||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||||||||
| 2658 | if (validateFromState >= 0
| 14-1906 | ||||||||||||||||||||||||||||||||||||
| 2659 | if (m_transactions.count()
| 0-16 | ||||||||||||||||||||||||||||||||||||
| 2660 | return never executed: false;return 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 blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 2667 | - | |||||||||||||||||||||||||||||||||||||
| 2668 | if (m_textDirty
| 16-3250 | ||||||||||||||||||||||||||||||||||||
| 2669 | textChanged = true; | - | ||||||||||||||||||||||||||||||||||||
| 2670 | m_textDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 2671 | - | |||||||||||||||||||||||||||||||||||||
| 2672 | m_preeditDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 2673 | - | |||||||||||||||||||||||||||||||||||||
| 2674 | alignmentChanged = determineHorizontalAlignment(); | - | ||||||||||||||||||||||||||||||||||||
| 2675 | if (edited
| 956-2294 | ||||||||||||||||||||||||||||||||||||
| 2676 | q->textEdited(); executed 2294 times by 1 test: q->textEdited();Executed by:
| 2294 | ||||||||||||||||||||||||||||||||||||
| 2677 | q->textChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2678 | } executed 3250 times by 4 tests: end of blockExecuted by:
| 3250 | ||||||||||||||||||||||||||||||||||||
| 2679 | - | |||||||||||||||||||||||||||||||||||||
| 2680 | updateDisplayText(alignmentChanged); | - | ||||||||||||||||||||||||||||||||||||
| 2681 | - | |||||||||||||||||||||||||||||||||||||
| 2682 | if (m_acceptableInput != wasAcceptable
| 230-3036 | ||||||||||||||||||||||||||||||||||||
| 2683 | q->acceptableInputChanged(); executed 230 times by 1 test: q->acceptableInputChanged();Executed by:
| 230 | ||||||||||||||||||||||||||||||||||||
| 2684 | } executed 3266 times by 4 tests: end of blockExecuted by:
| 3266 | ||||||||||||||||||||||||||||||||||||
| 2685 | - | |||||||||||||||||||||||||||||||||||||
| 2686 | if (m_preeditDirty
| 46-3636 | ||||||||||||||||||||||||||||||||||||
| 2687 | m_preeditDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 2688 | if (determineHorizontalAlignment()
| 4-42 | ||||||||||||||||||||||||||||||||||||
| 2689 | alignmentChanged = true; | - | ||||||||||||||||||||||||||||||||||||
| 2690 | updateLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 2691 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 2692 | } executed 46 times by 1 test: end of blockExecuted by:
| 46 | ||||||||||||||||||||||||||||||||||||
| 2693 | - | |||||||||||||||||||||||||||||||||||||
| 2694 | - | |||||||||||||||||||||||||||||||||||||
| 2695 | if (m_selDirty
| 230-3452 | ||||||||||||||||||||||||||||||||||||
| 2696 | m_selDirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 2697 | q->selectionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2698 | } executed 230 times by 1 test: end of blockExecuted by:
| 230 | ||||||||||||||||||||||||||||||||||||
| 2699 | - | |||||||||||||||||||||||||||||||||||||
| 2700 | - | |||||||||||||||||||||||||||||||||||||
| 2701 | inputMethodAttributesChanged |= (m_cursor != m_lastCursorPos); | - | ||||||||||||||||||||||||||||||||||||
| 2702 | if (inputMethodAttributesChanged
| 394-3288 | ||||||||||||||||||||||||||||||||||||
| 2703 | q->updateInputMethod(); executed 3288 times by 4 tests: q->updateInputMethod();Executed by:
| 3288 | ||||||||||||||||||||||||||||||||||||
| 2704 | - | |||||||||||||||||||||||||||||||||||||
| 2705 | emitUndoRedoChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 2706 | - | |||||||||||||||||||||||||||||||||||||
| 2707 | if (!emitCursorPositionChanged()
| 4-2734 | ||||||||||||||||||||||||||||||||||||
| 2708 | q->updateCursorRectangle(); executed 534 times by 1 test: q->updateCursorRectangle();Executed by:
| 534 | ||||||||||||||||||||||||||||||||||||
| 2709 | - | |||||||||||||||||||||||||||||||||||||
| 2710 | return executed 3682 times by 4 tests: true;return true;Executed by:
executed 3682 times by 4 tests: return true;Executed by:
| 3682 | ||||||||||||||||||||||||||||||||||||
| 2711 | } | - | ||||||||||||||||||||||||||||||||||||
| 2712 | - | |||||||||||||||||||||||||||||||||||||
| 2713 | - | |||||||||||||||||||||||||||||||||||||
| 2714 | - | |||||||||||||||||||||||||||||||||||||
| 2715 | - | |||||||||||||||||||||||||||||||||||||
| 2716 | - | |||||||||||||||||||||||||||||||||||||
| 2717 | - | |||||||||||||||||||||||||||||||||||||
| 2718 | void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool edited) | - | ||||||||||||||||||||||||||||||||||||
| 2719 | { | - | ||||||||||||||||||||||||||||||||||||
| 2720 | internalDeselect(); | - | ||||||||||||||||||||||||||||||||||||
| 2721 | QString oldText = m_text; | - | ||||||||||||||||||||||||||||||||||||
| 2722 | if (m_maskData
| 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: else {end of blockExecuted by:
| 726 | ||||||||||||||||||||||||||||||||||||
| 2726 | m_text = txt.isEmpty()
| 58-722 | ||||||||||||||||||||||||||||||||||||
| 2727 | } executed 780 times by 4 tests: end of blockExecuted by:
| 780 | ||||||||||||||||||||||||||||||||||||
| 2728 | m_history.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 2729 | m_undoState = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2730 | m_cursor = (pos < 0
| 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
| 0-1506 | ||||||||||||||||||||||||||||||||||||
| 2739 | if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)
| 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 blockExecuted by:
| 1506 | ||||||||||||||||||||||||||||||||||||
| 2746 | void QQuickTextInputPrivate::addCommand(const Command &cmd) | - | ||||||||||||||||||||||||||||||||||||
| 2747 | { | - | ||||||||||||||||||||||||||||||||||||
| 2748 | if (m_separator
| 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: else {end of blockExecuted by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 2752 | m_history.resize(m_undoState + 1); | - | ||||||||||||||||||||||||||||||||||||
| 2753 | } executed 4886 times by 1 test: end of blockExecuted by:
| 4886 | ||||||||||||||||||||||||||||||||||||
| 2754 | m_separator = false; | - | ||||||||||||||||||||||||||||||||||||
| 2755 | m_history[m_undoState++] = cmd; | - | ||||||||||||||||||||||||||||||||||||
| 2756 | } executed 5034 times by 1 test: end of blockExecuted by:
| 5034 | ||||||||||||||||||||||||||||||||||||
| 2757 | void QQuickTextInputPrivate::internalInsert(const QString &s) | - | ||||||||||||||||||||||||||||||||||||
| 2758 | { | - | ||||||||||||||||||||||||||||||||||||
| 2759 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2760 | if (m_echoMode == QQuickTextInput::Password
| 0-1524 | ||||||||||||||||||||||||||||||||||||
| 2761 | if (m_passwordMaskDelay > 0
| 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
| 506-1018 | ||||||||||||||||||||||||||||||||||||
| 2766 | QString ms = maskString(m_cursor, s); | - | ||||||||||||||||||||||||||||||||||||
| 2767 | for (int i = 0; i < ms.length()
| 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 blockExecuted by:
| 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: else {end of blockExecuted by:
| 506 | ||||||||||||||||||||||||||||||||||||
| 2776 | int remaining = m_maxLength - m_text.length(); | - | ||||||||||||||||||||||||||||||||||||
| 2777 | if (remaining != 0
| 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:
| 1220 | ||||||||||||||||||||||||||||||||||||
| 2782 | m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 2783 | } executed 998 times by 1 test: end of blockExecuted by:
| 998 | ||||||||||||||||||||||||||||||||||||
| 2784 | } executed 1018 times by 1 test: end of blockExecuted by:
| 1018 | ||||||||||||||||||||||||||||||||||||
| 2785 | } | - | ||||||||||||||||||||||||||||||||||||
| 2786 | void QQuickTextInputPrivate::internalDelete(bool wasBackspace) | - | ||||||||||||||||||||||||||||||||||||
| 2787 | { | - | ||||||||||||||||||||||||||||||||||||
| 2788 | if (m_cursor < m_text.length()
| 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
| 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: else {end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 2797 | m_text.remove(m_cursor, 1); | - | ||||||||||||||||||||||||||||||||||||
| 2798 | } executed 80 times by 1 test: end of blockExecuted by:
| 80 | ||||||||||||||||||||||||||||||||||||
| 2799 | m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 2800 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||||||||||||||
| 2801 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||||||||||||||
| 2802 | void QQuickTextInputPrivate::removeSelectedText() | - | ||||||||||||||||||||||||||||||||||||
| 2803 | { | - | ||||||||||||||||||||||||||||||||||||
| 2804 | if (m_selstart < m_selend
| 0-300 | ||||||||||||||||||||||||||||||||||||
| 2805 | cancelPasswordEchoTimer(); | - | ||||||||||||||||||||||||||||||||||||
| 2806 | int i ; | - | ||||||||||||||||||||||||||||||||||||
| 2807 | if (m_selstart <= m_cursor
| 0-184 | ||||||||||||||||||||||||||||||||||||
| 2808 | - | |||||||||||||||||||||||||||||||||||||
| 2809 | - | |||||||||||||||||||||||||||||||||||||
| 2810 | for (i = m_cursor; i >= m_selstart
| 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:
| 152 | ||||||||||||||||||||||||||||||||||||
| 2812 | for (i = m_selend - 1; i > m_cursor
| 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:
| 86 | ||||||||||||||||||||||||||||||||||||
| 2814 | } executed 144 times by 1 test: else {end of blockExecuted by:
| 144 | ||||||||||||||||||||||||||||||||||||
| 2815 | for (i = m_selend-1; i >= m_selstart
| 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:
| 378 | ||||||||||||||||||||||||||||||||||||
| 2817 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||||||||||||||
| 2818 | if (m_maskData
| 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
| 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: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2823 | m_text.remove(m_selstart, m_selend - m_selstart); | - | ||||||||||||||||||||||||||||||||||||
| 2824 | } executed 184 times by 1 test: end of blockExecuted by:
| 184 | ||||||||||||||||||||||||||||||||||||
| 2825 | if (m_cursor > m_selstart
| 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:
| 42 | ||||||||||||||||||||||||||||||||||||
| 2827 | internalDeselect(); | - | ||||||||||||||||||||||||||||||||||||
| 2828 | m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 2829 | } executed 184 times by 1 test: end of blockExecuted by:
| 184 | ||||||||||||||||||||||||||||||||||||
| 2830 | } executed 484 times by 1 test: end of blockExecuted by:
| 484 | ||||||||||||||||||||||||||||||||||||
| 2831 | bool QQuickTextInputPrivate::separateSelection() | - | ||||||||||||||||||||||||||||||||||||
| 2832 | { | - | ||||||||||||||||||||||||||||||||||||
| 2833 | if (hasSelectedText()
| 38-1750 | ||||||||||||||||||||||||||||||||||||
| 2834 | separate(); | - | ||||||||||||||||||||||||||||||||||||
| 2835 | addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend)); | - | ||||||||||||||||||||||||||||||||||||
| 2836 | return executed 38 times by 1 test: true;return true;Executed by:
executed 38 times by 1 test: return true;Executed by:
| 38 | ||||||||||||||||||||||||||||||||||||
| 2837 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 2838 | return executed 1750 times by 1 test: false;return false;Executed by:
executed 1750 times by 1 test: return false;Executed by:
| 1750 | ||||||||||||||||||||||||||||||||||||
| 2839 | } | - | ||||||||||||||||||||||||||||||||||||
| 2840 | } | - | ||||||||||||||||||||||||||||||||||||
| 2841 | - | |||||||||||||||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||||||||||||||
| 2843 | - | |||||||||||||||||||||||||||||||||||||
| 2844 | - | |||||||||||||||||||||||||||||||||||||
| 2845 | - | |||||||||||||||||||||||||||||||||||||
| 2846 | - | |||||||||||||||||||||||||||||||||||||
| 2847 | - | |||||||||||||||||||||||||||||||||||||
| 2848 | void QQuickTextInputPrivate::parseInputMask(const QString &maskFields) | - | ||||||||||||||||||||||||||||||||||||
| 2849 | { | - | ||||||||||||||||||||||||||||||||||||
| 2850 | int delimiter = maskFields.indexOf(QLatin1Char(';')); | - | ||||||||||||||||||||||||||||||||||||
| 2851 | if (maskFields.isEmpty()
| 0-254 | ||||||||||||||||||||||||||||||||||||
| 2852 | if (m_maskData
| 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 blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2858 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 2859 | } | - | ||||||||||||||||||||||||||||||||||||
| 2860 | - | |||||||||||||||||||||||||||||||||||||
| 2861 | if (delimiter == -1
| 58-196 | ||||||||||||||||||||||||||||||||||||
| 2862 | m_blank = QLatin1Char(' '); | - | ||||||||||||||||||||||||||||||||||||
| 2863 | m_inputMask = maskFields; | - | ||||||||||||||||||||||||||||||||||||
| 2864 | } executed 196 times by 1 test: else {end of blockExecuted by:
| 196 | ||||||||||||||||||||||||||||||||||||
| 2865 | m_inputMask = maskFields.left(delimiter); | - | ||||||||||||||||||||||||||||||||||||
| 2866 | m_blank = (
| 4-54 | ||||||||||||||||||||||||||||||||||||
| 2867 | } executed 58 times by 1 test: end of blockExecuted by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 2868 | - | |||||||||||||||||||||||||||||||||||||
| 2869 | - | |||||||||||||||||||||||||||||||||||||
| 2870 | m_maxLength = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2871 | QChar c = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2872 | for (int i=0; i<m_inputMask.length()
| 254-2682 | ||||||||||||||||||||||||||||||||||||
| 2873 | c = m_inputMask.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 2874 | if (i > 0
| 24-2428 | ||||||||||||||||||||||||||||||||||||
| 2875 | m_maxLength++; | - | ||||||||||||||||||||||||||||||||||||
| 2876 | continue; executed 24 times by 1 test: continue;Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 2877 | } | - | ||||||||||||||||||||||||||||||||||||
| 2878 | if (c != QLatin1Char('\\')
| 20-2638 | ||||||||||||||||||||||||||||||||||||
| 2879 | c != QLatin1Char('<')
| 90-2468 | ||||||||||||||||||||||||||||||||||||
| 2880 | c != QLatin1Char('{')
| 4-2372 | ||||||||||||||||||||||||||||||||||||
| 2881 | c != QLatin1Char('[')
| 4-2364 | ||||||||||||||||||||||||||||||||||||
| 2882 | m_maxLength++; executed 2360 times by 1 test: m_maxLength++;Executed by:
| 2360 | ||||||||||||||||||||||||||||||||||||
| 2883 | } executed 2658 times by 1 test: end of blockExecuted by:
| 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()
| 254-2682 | ||||||||||||||||||||||||||||||||||||
| 2894 | c = m_inputMask.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 2895 | if (escape
| 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: else if (c == QLatin1Char('<')end of blockExecuted by:
| 20-2572 | ||||||||||||||||||||||||||||||||||||
| 2903 | m = MaskInputData::Lower; | - | ||||||||||||||||||||||||||||||||||||
| 2904 | } executed 90 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 90-2480 | ||||||||||||||||||||||||||||||||||||
| 2905 | m = MaskInputData::Upper; | - | ||||||||||||||||||||||||||||||||||||
| 2906 | } executed 92 times by 1 test: else if (c == QLatin1Char('!')end of blockExecuted by:
| 80-2400 | ||||||||||||||||||||||||||||||||||||
| 2907 | m = MaskInputData::NoCaseMode; | - | ||||||||||||||||||||||||||||||||||||
| 2908 | } executed 80 times by 1 test: else if (c != QLatin1Char('{')end of blockExecuted by:
| 4-2396 | ||||||||||||||||||||||||||||||||||||
| 2909 | switch (c.unicode()) { | - | ||||||||||||||||||||||||||||||||||||
| 2910 | case executed 280 times by 1 test: 'A':case 'A':Executed by:
executed 280 times by 1 test: case 'A':Executed by:
| 280 | ||||||||||||||||||||||||||||||||||||
| 2911 | case executed 126 times by 1 test: 'a':case 'a':Executed by:
executed 126 times by 1 test: case 'a':Executed by:
| 126 | ||||||||||||||||||||||||||||||||||||
| 2912 | case executed 10 times by 1 test: 'N':case 'N':Executed by:
executed 10 times by 1 test: case 'N':Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2913 | case executed 12 times by 1 test: 'n':case 'n':Executed by:
executed 12 times by 1 test: case 'n':Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2914 | case executed 14 times by 1 test: 'X':case 'X':Executed by:
executed 14 times by 1 test: case 'X':Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 2915 | case executed 8 times by 1 test: 'x':case 'x':Executed by:
executed 8 times by 1 test: case 'x':Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 2916 | case executed 304 times by 1 test: '9':case '9':Executed by:
executed 304 times by 1 test: case '9':Executed by:
| 304 | ||||||||||||||||||||||||||||||||||||
| 2917 | case executed 936 times by 1 test: '0':case '0':Executed by:
executed 936 times by 1 test: case '0':Executed by:
| 936 | ||||||||||||||||||||||||||||||||||||
| 2918 | case executed 12 times by 1 test: 'D':case 'D':Executed by:
executed 12 times by 1 test: case 'D':Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2919 | case executed 10 times by 1 test: 'd':case 'd':Executed by:
executed 10 times by 1 test: case 'd':Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 2920 | case executed 8 times by 1 test: '#':case '#':Executed by:
executed 8 times by 1 test: case '#':Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 2921 | case executed 144 times by 1 test: 'H':case 'H':Executed by:
executed 144 times by 1 test: case 'H':Executed by:
| 144 | ||||||||||||||||||||||||||||||||||||
| 2922 | case executed 44 times by 1 test: 'h':case 'h':Executed by:
executed 44 times by 1 test: case 'h':Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||
| 2923 | case executed 38 times by 1 test: 'B':case 'B':Executed by:
executed 38 times by 1 test: case 'B':Executed by:
| 38 | ||||||||||||||||||||||||||||||||||||
| 2924 | case executed 38 times by 1 test: 'b':case 'b':Executed by:
executed 38 times by 1 test: case 'b':Executed by:
| 38 | ||||||||||||||||||||||||||||||||||||
| 2925 | s = false; | - | ||||||||||||||||||||||||||||||||||||
| 2926 | break; executed 1984 times by 1 test: break;Executed by:
| 1984 | ||||||||||||||||||||||||||||||||||||
| 2927 | case executed 20 times by 1 test: '\\':case '\\':Executed by:
executed 20 times by 1 test: case '\\':Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 2928 | escape = true; | - | ||||||||||||||||||||||||||||||||||||
| 2929 | (void)0; | - | ||||||||||||||||||||||||||||||||||||
| 2930 | default executed 380 times by 1 test: :default:Executed by:
executed 380 times by 1 test: default:Executed by:
code before this statement executed 20 times by 1 test: default:Executed by:
| 20-380 | ||||||||||||||||||||||||||||||||||||
| 2931 | s = true; | - | ||||||||||||||||||||||||||||||||||||
| 2932 | break; executed 400 times by 1 test: break;Executed by:
| 400 | ||||||||||||||||||||||||||||||||||||
| 2933 | } | - | ||||||||||||||||||||||||||||||||||||
| 2934 | - | |||||||||||||||||||||||||||||||||||||
| 2935 | if (!escape
| 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 blockExecuted by:
| 2364 | ||||||||||||||||||||||||||||||||||||
| 2941 | } executed 2384 times by 1 test: end of blockExecuted by:
| 2384 | ||||||||||||||||||||||||||||||||||||
| 2942 | } executed 2682 times by 1 test: end of blockExecuted by:
| 2682 | ||||||||||||||||||||||||||||||||||||
| 2943 | internalSetText(m_text); | - | ||||||||||||||||||||||||||||||||||||
| 2944 | } executed 254 times by 1 test: end of blockExecuted by:
| 254 | ||||||||||||||||||||||||||||||||||||
| 2945 | - | |||||||||||||||||||||||||||||||||||||
| 2946 | - | |||||||||||||||||||||||||||||||||||||
| 2947 | - | |||||||||||||||||||||||||||||||||||||
| 2948 | - | |||||||||||||||||||||||||||||||||||||
| 2949 | - | |||||||||||||||||||||||||||||||||||||
| 2950 | - | |||||||||||||||||||||||||||||||||||||
| 2951 | - | |||||||||||||||||||||||||||||||||||||
| 2952 | bool QQuickTextInputPrivate::isValidInput(QChar key, QChar mask) const | - | ||||||||||||||||||||||||||||||||||||
| 2953 | { | - | ||||||||||||||||||||||||||||||||||||
| 2954 | switch (mask.unicode()) { | - | ||||||||||||||||||||||||||||||||||||
| 2955 | case executed 1292 times by 1 test: 'A':case 'A':Executed by:
executed 1292 times by 1 test: case 'A':Executed by:
| 1292 | ||||||||||||||||||||||||||||||||||||
| 2956 | if (key.isLetter()
| 442-850 | ||||||||||||||||||||||||||||||||||||
| 2957 | return executed 850 times by 1 test: true;return true;Executed by:
executed 850 times by 1 test: return true;Executed by:
| 850 | ||||||||||||||||||||||||||||||||||||
| 2958 | break; executed 442 times by 1 test: break;Executed by:
| 442 | ||||||||||||||||||||||||||||||||||||
| 2959 | case executed 968 times by 1 test: 'a':case 'a':Executed by:
executed 968 times by 1 test: case 'a':Executed by:
| 968 | ||||||||||||||||||||||||||||||||||||
| 2960 | if (key.isLetter()
| 0-492 | ||||||||||||||||||||||||||||||||||||
| 2961 | return executed 968 times by 1 test: true;return true;Executed by:
executed 968 times by 1 test: return true;Executed by:
| 968 | ||||||||||||||||||||||||||||||||||||
| 2962 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2963 | case executed 32 times by 1 test: 'N':case 'N':Executed by:
executed 32 times by 1 test: case 'N':Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 2964 | if (key.isLetterOrNumber()
| 12-20 | ||||||||||||||||||||||||||||||||||||
| 2965 | return executed 20 times by 1 test: true;return true;Executed by:
executed 20 times by 1 test: return true;Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 2966 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 2967 | case executed 46 times by 1 test: 'n':case 'n':Executed by:
executed 46 times by 1 test: case 'n':Executed by:
| 46 | ||||||||||||||||||||||||||||||||||||
| 2968 | if (key.isLetterOrNumber()
| 0-28 | ||||||||||||||||||||||||||||||||||||
| 2969 | return executed 46 times by 1 test: true;return true;Executed by:
executed 46 times by 1 test: return true;Executed by:
| 46 | ||||||||||||||||||||||||||||||||||||
| 2970 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2971 | case executed 40 times by 1 test: 'X':case 'X':Executed by:
executed 40 times by 1 test: case 'X':Executed by:
| 40 | ||||||||||||||||||||||||||||||||||||
| 2972 | if (key.isPrint()
| 0-40 | ||||||||||||||||||||||||||||||||||||
| 2973 | return executed 40 times by 1 test: true;return true;Executed by:
executed 40 times by 1 test: return true;Executed by:
| 40 | ||||||||||||||||||||||||||||||||||||
| 2974 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2975 | case executed 28 times by 1 test: 'x':case 'x':Executed by:
executed 28 times by 1 test: case 'x':Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 2976 | if (key.isPrint()
| 0-28 | ||||||||||||||||||||||||||||||||||||
| 2977 | return executed 28 times by 1 test: true;return true;Executed by:
executed 28 times by 1 test: return true;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 2978 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2979 | case executed 1412 times by 1 test: '9':case '9':Executed by:
executed 1412 times by 1 test: case '9':Executed by:
| 1412 | ||||||||||||||||||||||||||||||||||||
| 2980 | if (key.isNumber()
| 626-786 | ||||||||||||||||||||||||||||||||||||
| 2981 | return executed 786 times by 1 test: true;return true;Executed by:
executed 786 times by 1 test: return true;Executed by:
| 786 | ||||||||||||||||||||||||||||||||||||
| 2982 | break; executed 626 times by 1 test: break;Executed by:
| 626 | ||||||||||||||||||||||||||||||||||||
| 2983 | case executed 4130 times by 1 test: '0':case '0':Executed by:
executed 4130 times by 1 test: case '0':Executed by:
| 4130 | ||||||||||||||||||||||||||||||||||||
| 2984 | if (key.isNumber()
| 226-2210 | ||||||||||||||||||||||||||||||||||||
| 2985 | return executed 3904 times by 1 test: true;return true;Executed by:
executed 3904 times by 1 test: return true;Executed by:
| 3904 | ||||||||||||||||||||||||||||||||||||
| 2986 | break; executed 226 times by 1 test: break;Executed by:
| 226 | ||||||||||||||||||||||||||||||||||||
| 2987 | case executed 48 times by 1 test: 'D':case 'D':Executed by:
executed 48 times by 1 test: case 'D':Executed by:
| 48 | ||||||||||||||||||||||||||||||||||||
| 2988 | if (key.isNumber()
| 4-24 | ||||||||||||||||||||||||||||||||||||
| 2989 | return executed 20 times by 1 test: true;return true;Executed by:
executed 20 times by 1 test: return true;Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||
| 2990 | break; executed 28 times by 1 test: break;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 2991 | case executed 32 times by 1 test: 'd':case 'd':Executed by:
executed 32 times by 1 test: case 'd':Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 2992 | if ((key.isNumber()
| 0-24 | ||||||||||||||||||||||||||||||||||||
| 2993 | return executed 32 times by 1 test: true;return true;Executed by:
executed 32 times by 1 test: return true;Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||
| 2994 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2995 | case executed 6 times by 1 test: '#':case '#':Executed by:
executed 6 times by 1 test: case '#':Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2996 | if (key.isNumber()
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 2997 | return executed 6 times by 1 test: true;return true;Executed by:
executed 6 times by 1 test: return true;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 2998 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2999 | case executed 392 times by 1 test: 'B':case 'B':Executed by:
executed 392 times by 1 test: case 'B':Executed by:
| 392 | ||||||||||||||||||||||||||||||||||||
| 3000 | if (key == QLatin1Char('0')
| 84-228 | ||||||||||||||||||||||||||||||||||||
| 3001 | return executed 248 times by 1 test: true;return true;Executed by:
executed 248 times by 1 test: return true;Executed by:
| 248 | ||||||||||||||||||||||||||||||||||||
| 3002 | break; executed 144 times by 1 test: break;Executed by:
| 144 | ||||||||||||||||||||||||||||||||||||
| 3003 | case executed 432 times by 1 test: 'b':case 'b':Executed by:
executed 432 times by 1 test: case 'b':Executed by:
| 432 | ||||||||||||||||||||||||||||||||||||
| 3004 | if (key == QLatin1Char('0')
| 58-372 | ||||||||||||||||||||||||||||||||||||
| 3005 | return executed 272 times by 1 test: true;return true;Executed by:
executed 272 times by 1 test: return true;Executed by:
| 272 | ||||||||||||||||||||||||||||||||||||
| 3006 | break; executed 160 times by 1 test: break;Executed by:
| 160 | ||||||||||||||||||||||||||||||||||||
| 3007 | case executed 1088 times by 1 test: 'H':case 'H':Executed by:
executed 1088 times by 1 test: case 'H':Executed by:
| 1088 | ||||||||||||||||||||||||||||||||||||
| 3008 | if (key.isNumber()
| 80-674 | ||||||||||||||||||||||||||||||||||||
| 3009 | return executed 800 times by 1 test: true;return true;Executed by:
executed 800 times by 1 test: return true;Executed by:
| 800 | ||||||||||||||||||||||||||||||||||||
| 3010 | break; executed 288 times by 1 test: break;Executed by:
| 288 | ||||||||||||||||||||||||||||||||||||
| 3011 | case executed 560 times by 1 test: 'h':case 'h':Executed by:
executed 560 times by 1 test: case 'h':Executed by:
| 560 | ||||||||||||||||||||||||||||||||||||
| 3012 | if (key.isNumber()
| 58-502 | ||||||||||||||||||||||||||||||||||||
| 3013 | return executed 400 times by 1 test: true;return true;Executed by:
executed 400 times by 1 test: return true;Executed by:
| 400 | ||||||||||||||||||||||||||||||||||||
| 3014 | break; executed 160 times by 1 test: break;Executed by:
| 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: false;return false;Executed by:
executed 2086 times by 1 test: return false;Executed by:
| 2086 | ||||||||||||||||||||||||||||||||||||
| 3019 | } | - | ||||||||||||||||||||||||||||||||||||
| 3020 | QQuickTextInputPrivate::ValidatorState QQuickTextInputPrivate::hasAcceptableInput(const QString &str) const | - | ||||||||||||||||||||||||||||||||||||
| 3021 | { | - | ||||||||||||||||||||||||||||||||||||
| 3022 | - | |||||||||||||||||||||||||||||||||||||
| 3023 | QString textCopy = str; | - | ||||||||||||||||||||||||||||||||||||
| 3024 | int cursorCopy = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 3025 | if (m_validator
| 188-2112 | ||||||||||||||||||||||||||||||||||||
| 3026 | QValidator::State state = m_validator->validate(textCopy, cursorCopy); | - | ||||||||||||||||||||||||||||||||||||
| 3027 | if (state != QValidator::Acceptable
| 68-120 | ||||||||||||||||||||||||||||||||||||
| 3028 | return executed 120 times by 2 tests: ValidatorState(state);return ValidatorState(state);Executed by:
executed 120 times by 2 tests: return ValidatorState(state);Executed by:
| 120 | ||||||||||||||||||||||||||||||||||||
| 3029 | } executed 68 times by 1 test: end of blockExecuted by:
| 68 | ||||||||||||||||||||||||||||||||||||
| 3030 | - | |||||||||||||||||||||||||||||||||||||
| 3031 | - | |||||||||||||||||||||||||||||||||||||
| 3032 | if (!m_maskData
| 930-1250 | ||||||||||||||||||||||||||||||||||||
| 3033 | return executed 930 times by 5 tests: AcceptableInput;return AcceptableInput;Executed by:
executed 930 times by 5 tests: return AcceptableInput;Executed by:
| 930 | ||||||||||||||||||||||||||||||||||||
| 3034 | - | |||||||||||||||||||||||||||||||||||||
| 3035 | if (str.length() != m_maxLength
| 0-1250 | ||||||||||||||||||||||||||||||||||||
| 3036 | return never executed: InvalidInput;return InvalidInput;never executed: return InvalidInput; | 0 | ||||||||||||||||||||||||||||||||||||
| 3037 | - | |||||||||||||||||||||||||||||||||||||
| 3038 | for (int i=0; i < m_maxLength
| 662-8450 | ||||||||||||||||||||||||||||||||||||
| 3039 | if (m_maskData[i].separator
| 1130-7320 | ||||||||||||||||||||||||||||||||||||
| 3040 | if (str.at(i) != m_maskData[i].maskChar
| 0-1130 | ||||||||||||||||||||||||||||||||||||
| 3041 | return never executed: InvalidInput;return InvalidInput;never executed: return InvalidInput; | 0 | ||||||||||||||||||||||||||||||||||||
| 3042 | } executed 1130 times by 1 test: else {end of blockExecuted by:
| 1130 | ||||||||||||||||||||||||||||||||||||
| 3043 | if (!isValidInput(str.at(i), m_maskData[i].maskChar)
| 588-6732 | ||||||||||||||||||||||||||||||||||||
| 3044 | return executed 588 times by 1 test: InvalidInput;return InvalidInput;Executed by:
executed 588 times by 1 test: return InvalidInput;Executed by:
| 588 | ||||||||||||||||||||||||||||||||||||
| 3045 | } executed 6732 times by 1 test: end of blockExecuted by:
| 6732 | ||||||||||||||||||||||||||||||||||||
| 3046 | } | - | ||||||||||||||||||||||||||||||||||||
| 3047 | return executed 662 times by 1 test: AcceptableInput;return AcceptableInput;Executed by:
executed 662 times by 1 test: return AcceptableInput;Executed by:
| 662 | ||||||||||||||||||||||||||||||||||||
| 3048 | } | - | ||||||||||||||||||||||||||||||||||||
| 3049 | QString QQuickTextInputPrivate::maskString(uint pos, const QString &str, bool clear) const | - | ||||||||||||||||||||||||||||||||||||
| 3050 | { | - | ||||||||||||||||||||||||||||||||||||
| 3051 | if (pos >= (uint)m_maxLength
| 24-1356 | ||||||||||||||||||||||||||||||||||||
| 3052 | return executed 24 times by 1 test: QString::fromLatin1("");return QString::fromLatin1("");Executed by:
executed 24 times by 1 test: return QString::fromLatin1("");Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 3053 | - | |||||||||||||||||||||||||||||||||||||
| 3054 | QString fill; | - | ||||||||||||||||||||||||||||||||||||
| 3055 | fill = clear
| 574-782 | ||||||||||||||||||||||||||||||||||||
| 3056 | - | |||||||||||||||||||||||||||||||||||||
| 3057 | int strIndex = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3058 | QString s = QString::fromLatin1(""); | - | ||||||||||||||||||||||||||||||||||||
| 3059 | int i = pos; | - | ||||||||||||||||||||||||||||||||||||
| 3060 | while (i < m_maxLength
| 216-3598 | ||||||||||||||||||||||||||||||||||||
| 3061 | if (strIndex < str.length()
| 1140-2458 | ||||||||||||||||||||||||||||||||||||
| 3062 | if (m_maskData[i].separator
| 188-2270 | ||||||||||||||||||||||||||||||||||||
| 3063 | s += m_maskData[i].maskChar; | - | ||||||||||||||||||||||||||||||||||||
| 3064 | if (str[strIndex] == m_maskData[i].maskChar
| 42-146 | ||||||||||||||||||||||||||||||||||||
| 3065 | strIndex++; executed 146 times by 1 test: strIndex++;Executed by:
| 146 | ||||||||||||||||||||||||||||||||||||
| 3066 | ++i; | - | ||||||||||||||||||||||||||||||||||||
| 3067 | } executed 188 times by 1 test: else {end of blockExecuted by:
| 188 | ||||||||||||||||||||||||||||||||||||
| 3068 | if (isValidInput(str[strIndex], m_maskData[i].maskChar)
| 590-1680 | ||||||||||||||||||||||||||||||||||||
| 3069 | switch (m_maskData[i].caseMode) { | - | ||||||||||||||||||||||||||||||||||||
| 3070 | case executed 130 times by 1 test: MaskInputData::Upper:case MaskInputData::Upper:Executed by:
executed 130 times by 1 test: case MaskInputData::Upper:Executed by:
| 130 | ||||||||||||||||||||||||||||||||||||
| 3071 | s += str[strIndex].toUpper(); | - | ||||||||||||||||||||||||||||||||||||
| 3072 | break; executed 130 times by 1 test: break;Executed by:
| 130 | ||||||||||||||||||||||||||||||||||||
| 3073 | case executed 128 times by 1 test: MaskInputData::Lower:case MaskInputData::Lower:Executed by:
executed 128 times by 1 test: case MaskInputData::Lower:Executed by:
| 128 | ||||||||||||||||||||||||||||||||||||
| 3074 | s += str[strIndex].toLower(); | - | ||||||||||||||||||||||||||||||||||||
| 3075 | break; executed 128 times by 1 test: break;Executed by:
| 128 | ||||||||||||||||||||||||||||||||||||
| 3076 | default executed 1422 times by 1 test: :default:Executed by:
executed 1422 times by 1 test: default:Executed by:
| 1422 | ||||||||||||||||||||||||||||||||||||
| 3077 | s += str[strIndex]; | - | ||||||||||||||||||||||||||||||||||||
| 3078 | } executed 1422 times by 1 test: end of blockExecuted by:
| 1422 | ||||||||||||||||||||||||||||||||||||
| 3079 | ++i; | - | ||||||||||||||||||||||||||||||||||||
| 3080 | } executed 1680 times by 1 test: else {end of blockExecuted by:
| 1680 | ||||||||||||||||||||||||||||||||||||
| 3081 | - | |||||||||||||||||||||||||||||||||||||
| 3082 | int n = findInMask(i, true, true, str[strIndex]); | - | ||||||||||||||||||||||||||||||||||||
| 3083 | if (n != -1
| 122-468 | ||||||||||||||||||||||||||||||||||||
| 3084 | if (str.length() != 1
| 0-90 | ||||||||||||||||||||||||||||||||||||
| 3085 | s += fill.midRef(i, n-i+1); | - | ||||||||||||||||||||||||||||||||||||
| 3086 | i = n + 1; | - | ||||||||||||||||||||||||||||||||||||
| 3087 | } executed 110 times by 1 test: end of blockExecuted by:
| 110 | ||||||||||||||||||||||||||||||||||||
| 3088 | } executed 122 times by 1 test: else {end of blockExecuted by:
| 122 | ||||||||||||||||||||||||||||||||||||
| 3089 | - | |||||||||||||||||||||||||||||||||||||
| 3090 | n = findInMask(i, true, false, str[strIndex]); | - | ||||||||||||||||||||||||||||||||||||
| 3091 | if (n != -1
| 8-460 | ||||||||||||||||||||||||||||||||||||
| 3092 | s += fill.midRef(i, n-i); | - | ||||||||||||||||||||||||||||||||||||
| 3093 | switch (m_maskData[n].caseMode) { | - | ||||||||||||||||||||||||||||||||||||
| 3094 | case executed 2 times by 1 test: MaskInputData::Upper:case MaskInputData::Upper:Executed by:
executed 2 times by 1 test: case MaskInputData::Upper:Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3095 | s += str[strIndex].toUpper(); | - | ||||||||||||||||||||||||||||||||||||
| 3096 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3097 | case never executed: MaskInputData::Lower:case 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:
executed 6 times by 1 test: default:Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3101 | s += str[strIndex]; | - | ||||||||||||||||||||||||||||||||||||
| 3102 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3103 | i = n + 1; | - | ||||||||||||||||||||||||||||||||||||
| 3104 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3105 | } executed 468 times by 1 test: end of blockExecuted by:
| 468 | ||||||||||||||||||||||||||||||||||||
| 3106 | } | - | ||||||||||||||||||||||||||||||||||||
| 3107 | ++strIndex; | - | ||||||||||||||||||||||||||||||||||||
| 3108 | } executed 2270 times by 1 test: end of blockExecuted by:
| 2270 | ||||||||||||||||||||||||||||||||||||
| 3109 | } else | - | ||||||||||||||||||||||||||||||||||||
| 3110 | break; executed 1140 times by 1 test: break;Executed by:
| 1140 | ||||||||||||||||||||||||||||||||||||
| 3111 | } | - | ||||||||||||||||||||||||||||||||||||
| 3112 | - | |||||||||||||||||||||||||||||||||||||
| 3113 | return executed 1356 times by 1 test: s;return s;Executed by:
executed 1356 times by 1 test: return s;Executed by:
| 1356 | ||||||||||||||||||||||||||||||||||||
| 3114 | } | - | ||||||||||||||||||||||||||||||||||||
| 3115 | QString QQuickTextInputPrivate::clearString(uint pos, uint len) const | - | ||||||||||||||||||||||||||||||||||||
| 3116 | { | - | ||||||||||||||||||||||||||||||||||||
| 3117 | if (pos >= (uint)m_maxLength
| 108-1446 | ||||||||||||||||||||||||||||||||||||
| 3118 | return executed 108 times by 1 test: QString();return QString();Executed by:
executed 108 times by 1 test: return QString();Executed by:
| 108 | ||||||||||||||||||||||||||||||||||||
| 3119 | - | |||||||||||||||||||||||||||||||||||||
| 3120 | QString s; | - | ||||||||||||||||||||||||||||||||||||
| 3121 | int end = qMin((uint)m_maxLength, pos + len); | - | ||||||||||||||||||||||||||||||||||||
| 3122 | for (int i = pos; i < end
| 1446-6834 | ||||||||||||||||||||||||||||||||||||
| 3123 | if (m_maskData[i].separator
| 1008-5826 | ||||||||||||||||||||||||||||||||||||
| 3124 | s += m_maskData[i].maskChar; executed 1008 times by 1 test: s += m_maskData[i].maskChar;Executed by:
| 1008 | ||||||||||||||||||||||||||||||||||||
| 3125 | else | - | ||||||||||||||||||||||||||||||||||||
| 3126 | s += m_blank; executed 5826 times by 1 test: s += m_blank;Executed by:
| 5826 | ||||||||||||||||||||||||||||||||||||
| 3127 | - | |||||||||||||||||||||||||||||||||||||
| 3128 | return executed 1446 times by 1 test: s;return s;Executed by:
executed 1446 times by 1 test: return s;Executed by:
| 1446 | ||||||||||||||||||||||||||||||||||||
| 3129 | } | - | ||||||||||||||||||||||||||||||||||||
| 3130 | - | |||||||||||||||||||||||||||||||||||||
| 3131 | - | |||||||||||||||||||||||||||||||||||||
| 3132 | - | |||||||||||||||||||||||||||||||||||||
| 3133 | - | |||||||||||||||||||||||||||||||||||||
| 3134 | - | |||||||||||||||||||||||||||||||||||||
| 3135 | - | |||||||||||||||||||||||||||||||||||||
| 3136 | - | |||||||||||||||||||||||||||||||||||||
| 3137 | QString QQuickTextInputPrivate::stripString(const QString &str) const | - | ||||||||||||||||||||||||||||||||||||
| 3138 | { | - | ||||||||||||||||||||||||||||||||||||
| 3139 | if (!m_maskData
| 0-1164 | ||||||||||||||||||||||||||||||||||||
| 3140 | return never executed: str;return 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
| 1164-4594 | ||||||||||||||||||||||||||||||||||||
| 3145 | if (m_maskData[i].separator
| 530-4064 | ||||||||||||||||||||||||||||||||||||
| 3146 | s += m_maskData[i].maskChar; executed 530 times by 1 test: s += m_maskData[i].maskChar;Executed by:
| 530 | ||||||||||||||||||||||||||||||||||||
| 3147 | else if (str[i] != m_blank
| 1778-2286 | ||||||||||||||||||||||||||||||||||||
| 3148 | s += str[i]; executed 1778 times by 1 test: s += str[i];Executed by:
| 1778 | ||||||||||||||||||||||||||||||||||||
| 3149 | } executed 4594 times by 1 test: end of blockExecuted by:
| 4594 | ||||||||||||||||||||||||||||||||||||
| 3150 | - | |||||||||||||||||||||||||||||||||||||
| 3151 | return executed 1164 times by 1 test: s;return s;Executed by:
executed 1164 times by 1 test: return s;Executed by:
| 1164 | ||||||||||||||||||||||||||||||||||||
| 3152 | } | - | ||||||||||||||||||||||||||||||||||||
| 3153 | - | |||||||||||||||||||||||||||||||||||||
| 3154 | - | |||||||||||||||||||||||||||||||||||||
| 3155 | - | |||||||||||||||||||||||||||||||||||||
| 3156 | - | |||||||||||||||||||||||||||||||||||||
| 3157 | - | |||||||||||||||||||||||||||||||||||||
| 3158 | int QQuickTextInputPrivate::findInMask(int pos, bool forward, bool findSeparator, QChar searchChar) const | - | ||||||||||||||||||||||||||||||||||||
| 3159 | { | - | ||||||||||||||||||||||||||||||||||||
| 3160 | if (pos >= m_maxLength
| 0-2024 | ||||||||||||||||||||||||||||||||||||
| 3161 | return executed 74 times by 1 test: -1;return -1;Executed by:
executed 74 times by 1 test: return -1;Executed by:
| 74 | ||||||||||||||||||||||||||||||||||||
| 3162 | - | |||||||||||||||||||||||||||||||||||||
| 3163 | int end = forward
| 276-1748 | ||||||||||||||||||||||||||||||||||||
| 3164 | int step = forward
| 276-1748 | ||||||||||||||||||||||||||||||||||||
| 3165 | int i = pos; | - | ||||||||||||||||||||||||||||||||||||
| 3166 | - | |||||||||||||||||||||||||||||||||||||
| 3167 | while (i != end
| 934-3364 | ||||||||||||||||||||||||||||||||||||
| 3168 | if (findSeparator
| 1374-1990 | ||||||||||||||||||||||||||||||||||||
| 3169 | if (m_maskData[i].separator
| 62-1190 | ||||||||||||||||||||||||||||||||||||
| 3170 | return executed 122 times by 1 test: i;return i;Executed by:
executed 122 times by 1 test: return i;Executed by:
| 122 | ||||||||||||||||||||||||||||||||||||
| 3171 | } executed 1252 times by 1 test: else {end of blockExecuted by:
| 1252 | ||||||||||||||||||||||||||||||||||||
| 3172 | if (!m_maskData[i].separator
| 114-1876 | ||||||||||||||||||||||||||||||||||||
| 3173 | if (searchChar.isNull()
| 916-960 | ||||||||||||||||||||||||||||||||||||
| 3174 | return executed 960 times by 1 test: i;return i;Executed by:
executed 960 times by 1 test: return i;Executed by:
| 960 | ||||||||||||||||||||||||||||||||||||
| 3175 | else if (isValidInput(searchChar, m_maskData[i].maskChar)
| 8-908 | ||||||||||||||||||||||||||||||||||||
| 3176 | return executed 8 times by 1 test: i;return i;Executed by:
executed 8 times by 1 test: return i;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3177 | } executed 908 times by 1 test: end of blockExecuted by:
| 908 | ||||||||||||||||||||||||||||||||||||
| 3178 | } executed 1022 times by 1 test: end of blockExecuted by:
| 1022 | ||||||||||||||||||||||||||||||||||||
| 3179 | i += step; | - | ||||||||||||||||||||||||||||||||||||
| 3180 | } executed 2274 times by 1 test: end of blockExecuted by:
| 2274 | ||||||||||||||||||||||||||||||||||||
| 3181 | return executed 934 times by 1 test: -1;return -1;Executed by:
executed 934 times by 1 test: return -1;Executed by:
| 934 | ||||||||||||||||||||||||||||||||||||
| 3182 | } | - | ||||||||||||||||||||||||||||||||||||
| 3183 | - | |||||||||||||||||||||||||||||||||||||
| 3184 | void QQuickTextInputPrivate::internalUndo(int until) | - | ||||||||||||||||||||||||||||||||||||
| 3185 | { | - | ||||||||||||||||||||||||||||||||||||
| 3186 | if (!isUndoAvailable()
| 14-166 | ||||||||||||||||||||||||||||||||||||
| 3187 | return; executed 14 times by 1 test: return;Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 3188 | cancelPasswordEchoTimer(); | - | ||||||||||||||||||||||||||||||||||||
| 3189 | internalDeselect(); | - | ||||||||||||||||||||||||||||||||||||
| 3190 | while (m_undoState
| 10-956 | ||||||||||||||||||||||||||||||||||||
| 3191 | Command& cmd = m_history[--m_undoState]; | - | ||||||||||||||||||||||||||||||||||||
| 3192 | switch (cmd.type) { | - | ||||||||||||||||||||||||||||||||||||
| 3193 | case executed 618 times by 1 test: Insert:case Insert:Executed by:
executed 618 times by 1 test: case Insert:Executed by:
| 618 | ||||||||||||||||||||||||||||||||||||
| 3194 | m_text.remove(cmd.pos, 1); | - | ||||||||||||||||||||||||||||||||||||
| 3195 | m_cursor = cmd.pos; | - | ||||||||||||||||||||||||||||||||||||
| 3196 | break; executed 618 times by 1 test: break;Executed by:
| 618 | ||||||||||||||||||||||||||||||||||||
| 3197 | case executed 38 times by 1 test: SetSelection:case SetSelection:Executed by:
executed 38 times by 1 test: case SetSelection:Executed by:
| 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:
| 38 | ||||||||||||||||||||||||||||||||||||
| 3202 | case executed 4 times by 1 test: Remove:case Remove:Executed by:
executed 4 times by 1 test: case Remove:Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3203 | case executed 102 times by 1 test: RemoveSelection:case RemoveSelection:Executed by:
executed 102 times by 1 test: case RemoveSelection:Executed by:
| 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:
| 106 | ||||||||||||||||||||||||||||||||||||
| 3207 | case never executed: Delete:case Delete:never executed: case Delete: | 0 | ||||||||||||||||||||||||||||||||||||
| 3208 | case executed 108 times by 1 test: DeleteSelection:case DeleteSelection:Executed by:
executed 108 times by 1 test: case DeleteSelection:Executed by:
| 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:
| 108 | ||||||||||||||||||||||||||||||||||||
| 3212 | case executed 76 times by 1 test: Separator:case Separator:Executed by:
executed 76 times by 1 test: case Separator:Executed by:
| 76 | ||||||||||||||||||||||||||||||||||||
| 3213 | continue; executed 76 times by 1 test: continue;Executed by:
| 76 | ||||||||||||||||||||||||||||||||||||
| 3214 | } | - | ||||||||||||||||||||||||||||||||||||
| 3215 | if (until < 0
| 20-850 | ||||||||||||||||||||||||||||||||||||
| 3216 | Command& next = m_history[m_undoState-1]; | - | ||||||||||||||||||||||||||||||||||||
| 3217 | if (next.type != cmd.type
| 152-646 | ||||||||||||||||||||||||||||||||||||
| 3218 | && next.type < RemoveSelection
| 54-98 | ||||||||||||||||||||||||||||||||||||
| 3219 | && (cmd.type < RemoveSelection
| 0-60 | ||||||||||||||||||||||||||||||||||||
| 3220 | break; executed 98 times by 1 test: break;Executed by:
| 98 | ||||||||||||||||||||||||||||||||||||
| 3221 | } | - | ||||||||||||||||||||||||||||||||||||
| 3222 | } executed 700 times by 1 test: end of blockExecuted by:
| 700 | ||||||||||||||||||||||||||||||||||||
| 3223 | } executed 772 times by 1 test: end of blockExecuted by:
| 772 | ||||||||||||||||||||||||||||||||||||
| 3224 | separate(); | - | ||||||||||||||||||||||||||||||||||||
| 3225 | m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 3226 | } executed 166 times by 1 test: end of blockExecuted by:
| 166 | ||||||||||||||||||||||||||||||||||||
| 3227 | - | |||||||||||||||||||||||||||||||||||||
| 3228 | void QQuickTextInputPrivate::internalRedo() | - | ||||||||||||||||||||||||||||||||||||
| 3229 | { | - | ||||||||||||||||||||||||||||||||||||
| 3230 | if (!isRedoAvailable()
| 0-12 | ||||||||||||||||||||||||||||||||||||
| 3231 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3232 | internalDeselect(); | - | ||||||||||||||||||||||||||||||||||||
| 3233 | while (m_undoState < m_history.size()
| 6-62 | ||||||||||||||||||||||||||||||||||||
| 3234 | Command& cmd = m_history[m_undoState++]; | - | ||||||||||||||||||||||||||||||||||||
| 3235 | switch (cmd.type) { | - | ||||||||||||||||||||||||||||||||||||
| 3236 | case executed 44 times by 1 test: Insert:case Insert:Executed by:
executed 44 times by 1 test: case Insert:Executed by:
| 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:
| 44 | ||||||||||||||||||||||||||||||||||||
| 3240 | case executed 2 times by 1 test: SetSelection:case SetSelection:Executed by:
executed 2 times by 1 test: case SetSelection:Executed by:
| 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:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3245 | case never executed: Remove:case Remove:never executed: case Remove: | 0 | ||||||||||||||||||||||||||||||||||||
| 3246 | case never executed: Delete:case Delete:never executed: case Delete: | 0 | ||||||||||||||||||||||||||||||||||||
| 3247 | case never executed: RemoveSelection:case RemoveSelection:never executed: case RemoveSelection: | 0 | ||||||||||||||||||||||||||||||||||||
| 3248 | case executed 10 times by 1 test: DeleteSelection:case DeleteSelection:Executed by:
executed 10 times by 1 test: case DeleteSelection:Executed by:
| 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:
| 10 | ||||||||||||||||||||||||||||||||||||
| 3254 | case executed 6 times by 1 test: Separator:case Separator:Executed by:
executed 6 times by 1 test: case Separator:Executed by:
| 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:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3259 | } | - | ||||||||||||||||||||||||||||||||||||
| 3260 | if (m_undoState < m_history.size()
| 6-56 | ||||||||||||||||||||||||||||||||||||
| 3261 | Command& next = m_history[m_undoState]; | - | ||||||||||||||||||||||||||||||||||||
| 3262 | if (next.type != cmd.type
| 14-42 | ||||||||||||||||||||||||||||||||||||
| 3263 | && cmd.type < RemoveSelection
| 2-12 | ||||||||||||||||||||||||||||||||||||
| 3264 | && next.type != Separator
| 6 | ||||||||||||||||||||||||||||||||||||
| 3265 | && (next.type < RemoveSelection
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 3266 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3267 | } | - | ||||||||||||||||||||||||||||||||||||
| 3268 | } executed 50 times by 1 test: end of blockExecuted by:
| 50 | ||||||||||||||||||||||||||||||||||||
| 3269 | } executed 56 times by 1 test: end of blockExecuted by:
| 56 | ||||||||||||||||||||||||||||||||||||
| 3270 | m_textDirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 3271 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 3272 | - | |||||||||||||||||||||||||||||||||||||
| 3273 | void 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
| 474-3246 | ||||||||||||||||||||||||||||||||||||
| 3283 | q->canUndoChanged(); executed 474 times by 1 test: q->canUndoChanged();Executed by:
| 474 | ||||||||||||||||||||||||||||||||||||
| 3284 | if (previousRedo != canRedo
| 90-3630 | ||||||||||||||||||||||||||||||||||||
| 3285 | q->canRedoChanged(); executed 90 times by 1 test: q->canRedoChanged();Executed by:
| 90 | ||||||||||||||||||||||||||||||||||||
| 3286 | } executed 3720 times by 4 tests: end of blockExecuted by:
| 3720 | ||||||||||||||||||||||||||||||||||||
| 3287 | - | |||||||||||||||||||||||||||||||||||||
| 3288 | - | |||||||||||||||||||||||||||||||||||||
| 3289 | - | |||||||||||||||||||||||||||||||||||||
| 3290 | - | |||||||||||||||||||||||||||||||||||||
| 3291 | - | |||||||||||||||||||||||||||||||||||||
| 3292 | - | |||||||||||||||||||||||||||||||||||||
| 3293 | - | |||||||||||||||||||||||||||||||||||||
| 3294 | bool QQuickTextInputPrivate::emitCursorPositionChanged() | - | ||||||||||||||||||||||||||||||||||||
| 3295 | { | - | ||||||||||||||||||||||||||||||||||||
| 3296 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3297 | if (m_cursor != m_lastCursorPos
| 1296-4792 | ||||||||||||||||||||||||||||||||||||
| 3298 | m_lastCursorPos = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 3299 | - | |||||||||||||||||||||||||||||||||||||
| 3300 | q->updateCursorRectangle(); | - | ||||||||||||||||||||||||||||||||||||
| 3301 | q->cursorPositionChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 3302 | - | |||||||||||||||||||||||||||||||||||||
| 3303 | if (!hasSelectedText()
| 592-4200 | ||||||||||||||||||||||||||||||||||||
| 3304 | if (lastSelectionStart != m_cursor
| 230-3970 | ||||||||||||||||||||||||||||||||||||
| 3305 | lastSelectionStart = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 3306 | q->selectionStartChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 3307 | } executed 3970 times by 4 tests: end of blockExecuted by:
| 3970 | ||||||||||||||||||||||||||||||||||||
| 3308 | if (lastSelectionEnd != m_cursor
| 230-3970 | ||||||||||||||||||||||||||||||||||||
| 3309 | lastSelectionEnd = m_cursor; | - | ||||||||||||||||||||||||||||||||||||
| 3310 | q->selectionEndChanged(); | - | ||||||||||||||||||||||||||||||||||||
| 3311 | } executed 3970 times by 4 tests: end of blockExecuted by:
| 3970 | ||||||||||||||||||||||||||||||||||||
| 3312 | } executed 4200 times by 4 tests: end of blockExecuted by:
| 4200 | ||||||||||||||||||||||||||||||||||||
| 3313 | - | |||||||||||||||||||||||||||||||||||||
| 3314 | - | |||||||||||||||||||||||||||||||||||||
| 3315 | if (QAccessible::isActive()
| 0-4792 | ||||||||||||||||||||||||||||||||||||
| 3316 | if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)
| 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: true;return true;Executed by:
executed 4792 times by 4 tests: return true;Executed by:
| 4792 | ||||||||||||||||||||||||||||||||||||
| 3324 | } | - | ||||||||||||||||||||||||||||||||||||
| 3325 | return executed 1296 times by 1 test: false;return false;Executed by:
executed 1296 times by 1 test: return false;Executed by:
| 1296 | ||||||||||||||||||||||||||||||||||||
| 3326 | } | - | ||||||||||||||||||||||||||||||||||||
| 3327 | - | |||||||||||||||||||||||||||||||||||||
| 3328 | - | |||||||||||||||||||||||||||||||||||||
| 3329 | void QQuickTextInputPrivate::setBlinkingCursorEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 3330 | { | - | ||||||||||||||||||||||||||||||||||||
| 3331 | if (enable == m_blinkEnabled
| 6-496 | ||||||||||||||||||||||||||||||||||||
| 3332 | return; executed 6 times by 1 test: return;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3333 | - | |||||||||||||||||||||||||||||||||||||
| 3334 | m_blinkEnabled = enable; | - | ||||||||||||||||||||||||||||||||||||
| 3335 | updateCursorBlinking(); | - | ||||||||||||||||||||||||||||||||||||
| 3336 | - | |||||||||||||||||||||||||||||||||||||
| 3337 | if (enable
| 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:
| 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:
| 124 | ||||||||||||||||||||||||||||||||||||
| 3341 | } | - | ||||||||||||||||||||||||||||||||||||
| 3342 | - | |||||||||||||||||||||||||||||||||||||
| 3343 | void QQuickTextInputPrivate::updateCursorBlinking() | - | ||||||||||||||||||||||||||||||||||||
| 3344 | { | - | ||||||||||||||||||||||||||||||||||||
| 3345 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3346 | - | |||||||||||||||||||||||||||||||||||||
| 3347 | if (m_blinkTimer
| 1024-1868 | ||||||||||||||||||||||||||||||||||||
| 3348 | q->killTimer(m_blinkTimer); | - | ||||||||||||||||||||||||||||||||||||
| 3349 | m_blinkTimer = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3350 | } executed 1868 times by 3 tests: end of blockExecuted by:
| 1868 | ||||||||||||||||||||||||||||||||||||
| 3351 | - | |||||||||||||||||||||||||||||||||||||
| 3352 | if (m_blinkEnabled
| 0-2374 | ||||||||||||||||||||||||||||||||||||
| 3353 | int flashTime = QGuiApplication::styleHints()->cursorFlashTime(); | - | ||||||||||||||||||||||||||||||||||||
| 3354 | if (flashTime >= 2
| 0-2112 | ||||||||||||||||||||||||||||||||||||
| 3355 | m_blinkTimer = q->startTimer(flashTime / 2); executed 2112 times by 3 tests: m_blinkTimer = q->startTimer(flashTime / 2);Executed by:
| 2112 | ||||||||||||||||||||||||||||||||||||
| 3356 | } executed 2112 times by 3 tests: end of blockExecuted by:
| 2112 | ||||||||||||||||||||||||||||||||||||
| 3357 | - | |||||||||||||||||||||||||||||||||||||
| 3358 | m_blinkStatus = 1; | - | ||||||||||||||||||||||||||||||||||||
| 3359 | updateType = UpdatePaintNode; | - | ||||||||||||||||||||||||||||||||||||
| 3360 | q->polish(); | - | ||||||||||||||||||||||||||||||||||||
| 3361 | q->update(); | - | ||||||||||||||||||||||||||||||||||||
| 3362 | } executed 2892 times by 4 tests: end of blockExecuted by:
| 2892 | ||||||||||||||||||||||||||||||||||||
| 3363 | - | |||||||||||||||||||||||||||||||||||||
| 3364 | void QQuickTextInput::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 3365 | { | - | ||||||||||||||||||||||||||||||||||||
| 3366 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3367 | if (event->timerId() == d->m_blinkTimer
| 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: else if (event->timerId() == d->m_passwordEchoTimer.timerId()end of blockExecuted by:
| 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 blockExecuted by:
| 565 | ||||||||||||||||||||||||||||||||||||
| 3378 | - | |||||||||||||||||||||||||||||||||||||
| 3379 | void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) | - | ||||||||||||||||||||||||||||||||||||
| 3380 | { | - | ||||||||||||||||||||||||||||||||||||
| 3381 | QQuickTextInput * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3382 | - | |||||||||||||||||||||||||||||||||||||
| 3383 | if (event->key() == Qt::Key_Enter
| 2-1966 | ||||||||||||||||||||||||||||||||||||
| 3384 | if (hasAcceptableInput(m_text) == AcceptableInput
| 2-6 | ||||||||||||||||||||||||||||||||||||
| 3385 | - | |||||||||||||||||||||||||||||||||||||
| 3386 | QInputMethod *inputMethod = QGuiApplication::inputMethod(); | - | ||||||||||||||||||||||||||||||||||||
| 3387 | inputMethod->commit(); | - | ||||||||||||||||||||||||||||||||||||
| 3388 | if (!(q->inputMethodHints() & Qt::ImhMultiLine)
| 0-8 | ||||||||||||||||||||||||||||||||||||
| 3389 | inputMethod->hide(); executed 8 times by 1 test: inputMethod->hide();Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3390 | - | |||||||||||||||||||||||||||||||||||||
| 3391 | if (activeFocus
| 0-8 | ||||||||||||||||||||||||||||||||||||
| 3392 | - | |||||||||||||||||||||||||||||||||||||
| 3393 | - | |||||||||||||||||||||||||||||||||||||
| 3394 | q->editingFinished(); | - | ||||||||||||||||||||||||||||||||||||
| 3395 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3396 | - | |||||||||||||||||||||||||||||||||||||
| 3397 | q->accepted(); | - | ||||||||||||||||||||||||||||||||||||
| 3398 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3399 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 3400 | return; executed 12 times by 1 test: return;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 3401 | } | - | ||||||||||||||||||||||||||||||||||||
| 3402 | - | |||||||||||||||||||||||||||||||||||||
| 3403 | if (m_blinkEnabled
| 94-1870 | ||||||||||||||||||||||||||||||||||||
| 3404 | updateCursorBlinking(); executed 1870 times by 2 tests: updateCursorBlinking();Executed by:
| 1870 | ||||||||||||||||||||||||||||||||||||
| 3405 | - | |||||||||||||||||||||||||||||||||||||
| 3406 | if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit
| 6-1958 | ||||||||||||||||||||||||||||||||||||
| 3407 | && !m_passwordEchoEditing
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 3408 | && !m_readOnly
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 3409 | && !event->text().isEmpty()
| 2-4 | ||||||||||||||||||||||||||||||||||||
| 3410 | && !(event->modifiers() & Qt::ControlModifier)
| 2 | ||||||||||||||||||||||||||||||||||||
| 3411 | - | |||||||||||||||||||||||||||||||||||||
| 3412 | - | |||||||||||||||||||||||||||||||||||||
| 3413 | - | |||||||||||||||||||||||||||||||||||||
| 3414 | - | |||||||||||||||||||||||||||||||||||||
| 3415 | - | |||||||||||||||||||||||||||||||||||||
| 3416 | updatePasswordEchoEditing(true); | - | ||||||||||||||||||||||||||||||||||||
| 3417 | clear(); | - | ||||||||||||||||||||||||||||||||||||
| 3418 | } executed 2 times by 1 test: end of blockExecuted by:
| 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
| 18-1946 | ||||||||||||||||||||||||||||||||||||
| 3429 | q->undo(); | - | ||||||||||||||||||||||||||||||||||||
| 3430 | } executed 18 times by 1 test: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 3431 | else if (event == QKeySequence::Redo
| 4-1942 | ||||||||||||||||||||||||||||||||||||
| 3432 | q->redo(); | - | ||||||||||||||||||||||||||||||||||||
| 3433 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3434 | else if (event == QKeySequence::SelectAll
| 4-1938 | ||||||||||||||||||||||||||||||||||||
| 3435 | selectAll(); | - | ||||||||||||||||||||||||||||||||||||
| 3436 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3437 | - | |||||||||||||||||||||||||||||||||||||
| 3438 | else if (event == QKeySequence::Copy
| 12-1926 | ||||||||||||||||||||||||||||||||||||
| 3439 | copy(); | - | ||||||||||||||||||||||||||||||||||||
| 3440 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 3441 | else if (event == QKeySequence::Paste
| 8-1918 | ||||||||||||||||||||||||||||||||||||
| 3442 | if (!m_readOnly
| 0-8 | ||||||||||||||||||||||||||||||||||||
| 3443 | QClipboard::Mode mode = QClipboard::Clipboard; | - | ||||||||||||||||||||||||||||||||||||
| 3444 | paste(mode); | - | ||||||||||||||||||||||||||||||||||||
| 3445 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3446 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3447 | else if (event == QKeySequence::Cut
| 4-1914 | ||||||||||||||||||||||||||||||||||||
| 3448 | q->cut(); | - | ||||||||||||||||||||||||||||||||||||
| 3449 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3450 | else if (event == QKeySequence::DeleteEndOfLine
| 4-1910 | ||||||||||||||||||||||||||||||||||||
| 3451 | if (!m_readOnly
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3452 | deleteEndOfLine(); executed 4 times by 1 test: deleteEndOfLine();Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3453 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3454 | - | |||||||||||||||||||||||||||||||||||||
| 3455 | else if (event == QKeySequence::MoveToStartOfLine
| 0-1818 | ||||||||||||||||||||||||||||||||||||
| 3456 | home(0); | - | ||||||||||||||||||||||||||||||||||||
| 3457 | } executed 92 times by 1 test: end of blockExecuted by:
| 92 | ||||||||||||||||||||||||||||||||||||
| 3458 | else if (event == QKeySequence::MoveToEndOfLine
| 0-1816 | ||||||||||||||||||||||||||||||||||||
| 3459 | end(0); | - | ||||||||||||||||||||||||||||||||||||
| 3460 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3461 | else if (event == QKeySequence::SelectStartOfLine
| 0-1810 | ||||||||||||||||||||||||||||||||||||
| 3462 | home(1); | - | ||||||||||||||||||||||||||||||||||||
| 3463 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3464 | else if (event == QKeySequence::SelectEndOfLine
| 0-1806 | ||||||||||||||||||||||||||||||||||||
| 3465 | end(1); | - | ||||||||||||||||||||||||||||||||||||
| 3466 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3467 | else if (event == QKeySequence::MoveToNextChar
| 16-1790 | ||||||||||||||||||||||||||||||||||||
| 3468 | if (hasSelectedText()
| 4-12 | ||||||||||||||||||||||||||||||||||||
| 3469 | moveCursor(selectionEnd(), false); | - | ||||||||||||||||||||||||||||||||||||
| 3470 | } executed 4 times by 1 test: else {end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3471 | cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1)); | - | ||||||||||||||||||||||||||||||||||||
| 3472 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 3473 | } | - | ||||||||||||||||||||||||||||||||||||
| 3474 | else if (event == QKeySequence::SelectNextChar
| 16-1774 | ||||||||||||||||||||||||||||||||||||
| 3475 | cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1)); | - | ||||||||||||||||||||||||||||||||||||
| 3476 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 3477 | else if (event == QKeySequence::MoveToPreviousChar
| 18-1756 | ||||||||||||||||||||||||||||||||||||
| 3478 | if (hasSelectedText()
| 2-16 | ||||||||||||||||||||||||||||||||||||
| 3479 | moveCursor(selectionStart(), false); | - | ||||||||||||||||||||||||||||||||||||
| 3480 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3481 | cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1)); | - | ||||||||||||||||||||||||||||||||||||
| 3482 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 3483 | } | - | ||||||||||||||||||||||||||||||||||||
| 3484 | else if (event == QKeySequence::SelectPreviousChar
| 16-1740 | ||||||||||||||||||||||||||||||||||||
| 3485 | cursorForward(1, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1)); | - | ||||||||||||||||||||||||||||||||||||
| 3486 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 3487 | else if (event == QKeySequence::MoveToNextWord
| 8-1732 | ||||||||||||||||||||||||||||||||||||
| 3488 | if (m_echoMode == QQuickTextInput::Normal
| 4 | ||||||||||||||||||||||||||||||||||||
| 3489 | layoutDirection() == Qt::LeftToRight ? cursorWordForward(0) : cursorWordBackward(0); executed 4 times by 1 test: layoutDirection() == Qt::LeftToRight ? cursorWordForward(0) : cursorWordBackward(0);Executed by:
| 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:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3492 | } | - | ||||||||||||||||||||||||||||||||||||
| 3493 | else if (event == QKeySequence::MoveToPreviousWord
| 12-1720 | ||||||||||||||||||||||||||||||||||||
| 3494 | if (m_echoMode == QQuickTextInput::Normal
| 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:
| 8 | ||||||||||||||||||||||||||||||||||||
| 3496 | else if (!m_readOnly
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3497 | layoutDirection() == Qt::LeftToRight ? home(0) : end(0); | - | ||||||||||||||||||||||||||||||||||||
| 3498 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3499 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||
| 3500 | else if (event == QKeySequence::SelectNextWord
| 2-1718 | ||||||||||||||||||||||||||||||||||||
| 3501 | if (m_echoMode == QQuickTextInput::Normal
| 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:
| 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
| 4-1714 | ||||||||||||||||||||||||||||||||||||
| 3507 | if (m_echoMode == QQuickTextInput::Normal
| 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:
| 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
| 22-1692 | ||||||||||||||||||||||||||||||||||||
| 3513 | if (!m_readOnly
| 0-22 | ||||||||||||||||||||||||||||||||||||
| 3514 | del(); executed 22 times by 1 test: del();Executed by:
| 22 | ||||||||||||||||||||||||||||||||||||
| 3515 | } executed 22 times by 1 test: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||||||||||||||
| 3516 | else if (event == QKeySequence::DeleteEndOfWord
| 6-1686 | ||||||||||||||||||||||||||||||||||||
| 3517 | if (!m_readOnly
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 3518 | deleteEndOfWord(); executed 6 times by 1 test: deleteEndOfWord();Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3519 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3520 | else if (event == QKeySequence::DeleteStartOfWord
| 6-1680 | ||||||||||||||||||||||||||||||||||||
| 3521 | if (!m_readOnly
| 0-6 | ||||||||||||||||||||||||||||||||||||
| 3522 | deleteStartOfWord(); executed 6 times by 1 test: deleteStartOfWord();Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3523 | } executed 6 times by 1 test: else if (event == QKeySequence::DeleteCompleteLineend of blockExecuted by:
| 2-1678 | ||||||||||||||||||||||||||||||||||||
| 3524 | if (!m_readOnly
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 3525 | selectAll(); | - | ||||||||||||||||||||||||||||||||||||
| 3526 | - | |||||||||||||||||||||||||||||||||||||
| 3527 | copy(); | - | ||||||||||||||||||||||||||||||||||||
| 3528 | - | |||||||||||||||||||||||||||||||||||||
| 3529 | del(); | - | ||||||||||||||||||||||||||||||||||||
| 3530 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3531 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3532 | - | |||||||||||||||||||||||||||||||||||||
| 3533 | else { | - | ||||||||||||||||||||||||||||||||||||
| 3534 | bool handled = false; | - | ||||||||||||||||||||||||||||||||||||
| 3535 | if (event->modifiers() & Qt::ControlModifier
| 52-1626 | ||||||||||||||||||||||||||||||||||||
| 3536 | switch (event->key()) { | - | ||||||||||||||||||||||||||||||||||||
| 3537 | case never executed: Qt::Key_Backspace:case Qt::Key_Backspace:never executed: case Qt::Key_Backspace: | 0 | ||||||||||||||||||||||||||||||||||||
| 3538 | if (!m_readOnly
| 0 | ||||||||||||||||||||||||||||||||||||
| 3539 | deleteStartOfWord(); never executed: deleteStartOfWord(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3540 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3541 | default executed 52 times by 1 test: :default:Executed by:
executed 52 times by 1 test: default:Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||
| 3542 | if (!handled
| 0-52 | ||||||||||||||||||||||||||||||||||||
| 3543 | unknown = true; executed 52 times by 1 test: unknown = true;Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||
| 3544 | } executed 52 times by 1 test: end of blockExecuted by:
| 52 | ||||||||||||||||||||||||||||||||||||
| 3545 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 3546 | switch (event->key()) { | - | ||||||||||||||||||||||||||||||||||||
| 3547 | case executed 60 times by 1 test: Qt::Key_Backspace:case Qt::Key_Backspace:Executed by:
executed 60 times by 1 test: case Qt::Key_Backspace:Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||
| 3548 | if (!m_readOnly
| 0-60 | ||||||||||||||||||||||||||||||||||||
| 3549 | backspace(); | - | ||||||||||||||||||||||||||||||||||||
| 3550 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||||||||||||||||||||||||||||||||
| 3551 | break; executed 60 times by 1 test: break;Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||
| 3552 | default executed 1566 times by 2 tests: :default:Executed by:
executed 1566 times by 2 tests: default:Executed by:
| 1566 | ||||||||||||||||||||||||||||||||||||
| 3553 | if (!handled
| 0-1566 | ||||||||||||||||||||||||||||||||||||
| 3554 | unknown = true; executed 1566 times by 2 tests: unknown = true;Executed by:
| 1566 | ||||||||||||||||||||||||||||||||||||
| 3555 | } executed 1566 times by 2 tests: end of blockExecuted by:
| 1566 | ||||||||||||||||||||||||||||||||||||
| 3556 | } | - | ||||||||||||||||||||||||||||||||||||
| 3557 | } | - | ||||||||||||||||||||||||||||||||||||
| 3558 | - | |||||||||||||||||||||||||||||||||||||
| 3559 | if (event->key() == Qt::Key_Direction_L
| 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 blockExecuted by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 3563 | - | |||||||||||||||||||||||||||||||||||||
| 3564 | if (unknown
| 94-1560 | ||||||||||||||||||||||||||||||||||||
| 3565 | if (m_inputControl->isAcceptableInput(event)
| 106-1360 | ||||||||||||||||||||||||||||||||||||
| 3566 | if (overwriteMode
| 10-1350 | ||||||||||||||||||||||||||||||||||||
| 3567 | - | |||||||||||||||||||||||||||||||||||||
| 3568 | - | |||||||||||||||||||||||||||||||||||||
| 3569 | && !hasSelectedText()
| 0-10 | ||||||||||||||||||||||||||||||||||||
| 3570 | && !(m_cursor == q_func()->text().length())
| 0-10 | ||||||||||||||||||||||||||||||||||||
| 3571 | del(); | - | ||||||||||||||||||||||||||||||||||||
| 3572 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 3573 | - | |||||||||||||||||||||||||||||||||||||
| 3574 | insert(event->text()); | - | ||||||||||||||||||||||||||||||||||||
| 3575 | event->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 3576 | return; executed 1360 times by 1 test: return;Executed by:
| 1360 | ||||||||||||||||||||||||||||||||||||
| 3577 | } | - | ||||||||||||||||||||||||||||||||||||
| 3578 | } executed 106 times by 2 tests: end of blockExecuted by:
| 106 | ||||||||||||||||||||||||||||||||||||
| 3579 | - | |||||||||||||||||||||||||||||||||||||
| 3580 | if (unknown
| 200-404 | ||||||||||||||||||||||||||||||||||||
| 3581 | event->ignore(); executed 200 times by 2 tests: event->ignore();Executed by:
| 200 | ||||||||||||||||||||||||||||||||||||
| 3582 | else | - | ||||||||||||||||||||||||||||||||||||
| 3583 | event->accept(); executed 404 times by 1 test: event->accept();Executed by:
| 404 | ||||||||||||||||||||||||||||||||||||
| 3584 | } | - | ||||||||||||||||||||||||||||||||||||
| 3585 | - | |||||||||||||||||||||||||||||||||||||
| 3586 | - | |||||||||||||||||||||||||||||||||||||
| 3587 | - | |||||||||||||||||||||||||||||||||||||
| 3588 | - | |||||||||||||||||||||||||||||||||||||
| 3589 | - | |||||||||||||||||||||||||||||||||||||
| 3590 | - | |||||||||||||||||||||||||||||||||||||
| 3591 | - | |||||||||||||||||||||||||||||||||||||
| 3592 | void 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 blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3602 | - | |||||||||||||||||||||||||||||||||||||
| 3603 | - | |||||||||||||||||||||||||||||||||||||
| 3604 | - | |||||||||||||||||||||||||||||||||||||
| 3605 | - | |||||||||||||||||||||||||||||||||||||
| 3606 | - | |||||||||||||||||||||||||||||||||||||
| 3607 | - | |||||||||||||||||||||||||||||||||||||
| 3608 | - | |||||||||||||||||||||||||||||||||||||
| 3609 | void 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 blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3621 | - | |||||||||||||||||||||||||||||||||||||
| 3622 | - | |||||||||||||||||||||||||||||||||||||
| 3623 | - | |||||||||||||||||||||||||||||||||||||
| 3624 | - | |||||||||||||||||||||||||||||||||||||
| 3625 | - | |||||||||||||||||||||||||||||||||||||
| 3626 | - | |||||||||||||||||||||||||||||||||||||
| 3627 | - | |||||||||||||||||||||||||||||||||||||
| 3628 | void 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 blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3638 | void 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 blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3644 | void QQuickTextInput::clear() | - | ||||||||||||||||||||||||||||||||||||
| 3645 | { | - | ||||||||||||||||||||||||||||||||||||
| 3646 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3647 | d->resetInputMethod(); | - | ||||||||||||||||||||||||||||||||||||
| 3648 | d->clear(); | - | ||||||||||||||||||||||||||||||||||||
| 3649 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 3650 | qreal QQuickTextInput::padding() const | - | ||||||||||||||||||||||||||||||||||||
| 3651 | { | - | ||||||||||||||||||||||||||||||||||||
| 3652 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3653 | return executed 4 times by 1 test: d->padding();return d->padding();Executed by:
executed 4 times by 1 test: return d->padding();Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3654 | } | - | ||||||||||||||||||||||||||||||||||||
| 3655 | - | |||||||||||||||||||||||||||||||||||||
| 3656 | void QQuickTextInput::setPadding(qreal padding) | - | ||||||||||||||||||||||||||||||||||||
| 3657 | { | - | ||||||||||||||||||||||||||||||||||||
| 3658 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3659 | if (qFuzzyCompare(d->padding(), padding)
| 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()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3666 | topPaddingChanged(); executed 2 times by 1 test: topPaddingChanged();Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3667 | if (!d->extra.isAllocated()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3668 | leftPaddingChanged(); executed 2 times by 1 test: leftPaddingChanged();Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3669 | if (!d->extra.isAllocated()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3670 | rightPaddingChanged(); executed 2 times by 1 test: rightPaddingChanged();Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3671 | if (!d->extra.isAllocated()
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 3672 | bottomPaddingChanged(); executed 2 times by 1 test: bottomPaddingChanged();Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3673 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3674 | - | |||||||||||||||||||||||||||||||||||||
| 3675 | void QQuickTextInput::resetPadding() | - | ||||||||||||||||||||||||||||||||||||
| 3676 | { | - | ||||||||||||||||||||||||||||||||||||
| 3677 | setPadding(0); | - | ||||||||||||||||||||||||||||||||||||
| 3678 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3679 | - | |||||||||||||||||||||||||||||||||||||
| 3680 | qreal QQuickTextInput::topPadding() const | - | ||||||||||||||||||||||||||||||||||||
| 3681 | { | - | ||||||||||||||||||||||||||||||||||||
| 3682 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3683 | if (d->extra.isAllocated()
| 78-24248 | ||||||||||||||||||||||||||||||||||||
| 3684 | return executed 356 times by 1 test: d->extra->topPadding;return d->extra->topPadding;Executed by:
executed 356 times by 1 test: return d->extra->topPadding;Executed by:
| 356 | ||||||||||||||||||||||||||||||||||||
| 3685 | return executed 24326 times by 5 tests: d->padding();return d->padding();Executed by:
executed 24326 times by 5 tests: return d->padding();Executed by:
| 24326 | ||||||||||||||||||||||||||||||||||||
| 3686 | } | - | ||||||||||||||||||||||||||||||||||||
| 3687 | - | |||||||||||||||||||||||||||||||||||||
| 3688 | void QQuickTextInput::setTopPadding(qreal padding) | - | ||||||||||||||||||||||||||||||||||||
| 3689 | { | - | ||||||||||||||||||||||||||||||||||||
| 3690 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3691 | d->setTopPadding(padding); | - | ||||||||||||||||||||||||||||||||||||
| 3692 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 3693 | - | |||||||||||||||||||||||||||||||||||||
| 3694 | void QQuickTextInput::resetTopPadding() | - | ||||||||||||||||||||||||||||||||||||
| 3695 | { | - | ||||||||||||||||||||||||||||||||||||
| 3696 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3697 | d->setTopPadding(0, true); | - | ||||||||||||||||||||||||||||||||||||
| 3698 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3699 | - | |||||||||||||||||||||||||||||||||||||
| 3700 | qreal QQuickTextInput::leftPadding() const | - | ||||||||||||||||||||||||||||||||||||
| 3701 | { | - | ||||||||||||||||||||||||||||||||||||
| 3702 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3703 | if (d->extra.isAllocated()
| 58-17434 | ||||||||||||||||||||||||||||||||||||
| 3704 | return executed 58 times by 1 test: d->extra->leftPadding;return d->extra->leftPadding;Executed by:
executed 58 times by 1 test: return d->extra->leftPadding;Executed by:
| 58 | ||||||||||||||||||||||||||||||||||||
| 3705 | return executed 17618 times by 5 tests: d->padding();return d->padding();Executed by:
executed 17618 times by 5 tests: return d->padding();Executed by:
| 17618 | ||||||||||||||||||||||||||||||||||||
| 3706 | } | - | ||||||||||||||||||||||||||||||||||||
| 3707 | - | |||||||||||||||||||||||||||||||||||||
| 3708 | void QQuickTextInput::setLeftPadding(qreal padding) | - | ||||||||||||||||||||||||||||||||||||
| 3709 | { | - | ||||||||||||||||||||||||||||||||||||
| 3710 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3711 | d->setLeftPadding(padding); | - | ||||||||||||||||||||||||||||||||||||
| 3712 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3713 | - | |||||||||||||||||||||||||||||||||||||
| 3714 | void QQuickTextInput::resetLeftPadding() | - | ||||||||||||||||||||||||||||||||||||
| 3715 | { | - | ||||||||||||||||||||||||||||||||||||
| 3716 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3717 | d->setLeftPadding(0, true); | - | ||||||||||||||||||||||||||||||||||||
| 3718 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3719 | - | |||||||||||||||||||||||||||||||||||||
| 3720 | qreal QQuickTextInput::rightPadding() const | - | ||||||||||||||||||||||||||||||||||||
| 3721 | { | - | ||||||||||||||||||||||||||||||||||||
| 3722 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3723 | if (d->extra.isAllocated()
| 60-14345 | ||||||||||||||||||||||||||||||||||||
| 3724 | return executed 60 times by 1 test: d->extra->rightPadding;return d->extra->rightPadding;Executed by:
executed 60 times by 1 test: return d->extra->rightPadding;Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||
| 3725 | return executed 14525 times by 5 tests: d->padding();return d->padding();Executed by:
executed 14525 times by 5 tests: return d->padding();Executed by:
| 14525 | ||||||||||||||||||||||||||||||||||||
| 3726 | } | - | ||||||||||||||||||||||||||||||||||||
| 3727 | - | |||||||||||||||||||||||||||||||||||||
| 3728 | void QQuickTextInput::setRightPadding(qreal padding) | - | ||||||||||||||||||||||||||||||||||||
| 3729 | { | - | ||||||||||||||||||||||||||||||||||||
| 3730 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3731 | d->setRightPadding(padding); | - | ||||||||||||||||||||||||||||||||||||
| 3732 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 3733 | - | |||||||||||||||||||||||||||||||||||||
| 3734 | void QQuickTextInput::resetRightPadding() | - | ||||||||||||||||||||||||||||||||||||
| 3735 | { | - | ||||||||||||||||||||||||||||||||||||
| 3736 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3737 | d->setRightPadding(0, true); | - | ||||||||||||||||||||||||||||||||||||
| 3738 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3739 | - | |||||||||||||||||||||||||||||||||||||
| 3740 | qreal QQuickTextInput::bottomPadding() const | - | ||||||||||||||||||||||||||||||||||||
| 3741 | { | - | ||||||||||||||||||||||||||||||||||||
| 3742 | const QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3743 | if (d->extra.isAllocated()
| 28-15165 | ||||||||||||||||||||||||||||||||||||
| 3744 | return executed 280 times by 1 test: d->extra->bottomPadding;return d->extra->bottomPadding;Executed by:
executed 280 times by 1 test: return d->extra->bottomPadding;Executed by:
| 280 | ||||||||||||||||||||||||||||||||||||
| 3745 | return executed 15193 times by 5 tests: d->padding();return d->padding();Executed by:
executed 15193 times by 5 tests: return d->padding();Executed by:
| 15193 | ||||||||||||||||||||||||||||||||||||
| 3746 | } | - | ||||||||||||||||||||||||||||||||||||
| 3747 | - | |||||||||||||||||||||||||||||||||||||
| 3748 | void QQuickTextInput::setBottomPadding(qreal padding) | - | ||||||||||||||||||||||||||||||||||||
| 3749 | { | - | ||||||||||||||||||||||||||||||||||||
| 3750 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3751 | d->setBottomPadding(padding); | - | ||||||||||||||||||||||||||||||||||||
| 3752 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||
| 3753 | - | |||||||||||||||||||||||||||||||||||||
| 3754 | void QQuickTextInput::resetBottomPadding() | - | ||||||||||||||||||||||||||||||||||||
| 3755 | { | - | ||||||||||||||||||||||||||||||||||||
| 3756 | QQuickTextInputPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3757 | d->setBottomPadding(0, true); | - | ||||||||||||||||||||||||||||||||||||
| 3758 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 3759 | - | |||||||||||||||||||||||||||||||||||||
| 3760 | - | |||||||||||||||||||||||||||||||||||||
| 3761 | - | |||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |