| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextinput_p_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | class QQuickTextNode; | - | ||||||
| 7 | class QInputControl; | - | ||||||
| 8 | - | |||||||
| 9 | class __attribute__((visibility("default"))) QQuickTextInputPrivate : public QQuickImplicitSizeItemPrivate | - | ||||||
| 10 | { | - | ||||||
| 11 | public: | - | ||||||
| 12 | inline QQuickTextInput* q_func() { return static_cast<QQuickTextInput *>(q_ptr); } inline const QQuickTextInput* q_func() const { return static_cast<const QQuickTextInput *>(q_ptr); } friend class QQuickTextInput; | - | ||||||
| 13 | - | |||||||
| 14 | typedef QQuickTextInput Public; | - | ||||||
| 15 | - | |||||||
| 16 | struct ExtraData { | - | ||||||
| 17 | ExtraData(); | - | ||||||
| 18 | - | |||||||
| 19 | qreal padding; | - | ||||||
| 20 | qreal topPadding; | - | ||||||
| 21 | qreal leftPadding; | - | ||||||
| 22 | qreal rightPadding; | - | ||||||
| 23 | qreal bottomPadding; | - | ||||||
| 24 | bool explicitTopPadding : 1; | - | ||||||
| 25 | bool explicitLeftPadding : 1; | - | ||||||
| 26 | bool explicitRightPadding : 1; | - | ||||||
| 27 | bool explicitBottomPadding : 1; | - | ||||||
| 28 | bool implicitResize : 1; | - | ||||||
| 29 | }; | - | ||||||
| 30 | QLazilyAllocated<ExtraData> extra; | - | ||||||
| 31 | - | |||||||
| 32 | QQuickTextInputPrivate() | - | ||||||
| 33 | : hscroll(0) | - | ||||||
| 34 | , vscroll(0) | - | ||||||
| 35 | , cursorItem(nullptr) | - | ||||||
| 36 | , textNode(nullptr) | - | ||||||
| 37 | , m_maskData(nullptr) | - | ||||||
| 38 | , color(QRgb(0xFF000000)) | - | ||||||
| 39 | , selectionColor(QRgb(0xFF000080)) | - | ||||||
| 40 | , selectedTextColor(QRgb(0xFFFFFFFF)) | - | ||||||
| 41 | , m_cursor(0) | - | ||||||
| 42 | - | |||||||
| 43 | , m_preeditCursor(0) | - | ||||||
| 44 | - | |||||||
| 45 | , m_blinkEnabled(false) | - | ||||||
| 46 | , m_blinkTimer(0) | - | ||||||
| 47 | , m_maxLength(32767) | - | ||||||
| 48 | , m_lastCursorPos(-1) | - | ||||||
| 49 | , m_undoState(0) | - | ||||||
| 50 | , m_selstart(0) | - | ||||||
| 51 | , m_selend(0) | - | ||||||
| 52 | - | |||||||
| 53 | , inputMethodHints(Qt::ImhNone) | - | ||||||
| 54 | - | |||||||
| 55 | , hAlign(QQuickTextInput::AlignLeft) | - | ||||||
| 56 | , vAlign(QQuickTextInput::AlignTop) | - | ||||||
| 57 | , wrapMode(QQuickTextInput::NoWrap) | - | ||||||
| 58 | , m_echoMode(QQuickTextInput::Normal) | - | ||||||
| 59 | , renderType(QQuickTextUtil::textRenderType<QQuickTextInput>()) | - | ||||||
| 60 | , updateType(UpdatePaintNode) | - | ||||||
| 61 | , mouseSelectionMode(QQuickTextInput::SelectCharacters) | - | ||||||
| 62 | , m_layoutDirection(Qt::LayoutDirectionAuto) | - | ||||||
| 63 | , m_passwordCharacter(QGuiApplication::styleHints()->passwordMaskCharacter()) | - | ||||||
| 64 | , m_passwordMaskDelay(QGuiApplication::styleHints()->passwordMaskDelay()) | - | ||||||
| 65 | , focusOnPress(true) | - | ||||||
| 66 | , cursorVisible(false) | - | ||||||
| 67 | , cursorPending(false) | - | ||||||
| 68 | , autoScroll(true) | - | ||||||
| 69 | , selectByMouse(false) | - | ||||||
| 70 | , canPaste(false) | - | ||||||
| 71 | , canPasteValid(false) | - | ||||||
| 72 | , canUndo(false) | - | ||||||
| 73 | , canRedo(false) | - | ||||||
| 74 | , hAlignImplicit(true) | - | ||||||
| 75 | , selectPressed(false) | - | ||||||
| 76 | , textLayoutDirty(true) | - | ||||||
| 77 | , persistentSelection(false) | - | ||||||
| 78 | , hasImState(false) | - | ||||||
| 79 | , m_separator(0) | - | ||||||
| 80 | , m_readOnly(0) | - | ||||||
| 81 | , m_textDirty(0) | - | ||||||
| 82 | - | |||||||
| 83 | , m_preeditDirty(0) | - | ||||||
| 84 | - | |||||||
| 85 | , m_selDirty(0) | - | ||||||
| 86 | , m_validInput(1) | - | ||||||
| 87 | , m_acceptableInput(1) | - | ||||||
| 88 | , m_blinkStatus(0) | - | ||||||
| 89 | , m_passwordEchoEditing(false) | - | ||||||
| 90 | , inLayout(false) | - | ||||||
| 91 | , requireImplicitWidth(false) | - | ||||||
| 92 | , overwriteMode(false) | - | ||||||
| 93 | { | - | ||||||
| 94 | } executed 1042 times by 5 tests: end of blockExecuted by:
| 1042 | ||||||
| 95 | - | |||||||
| 96 | ~QQuickTextInputPrivate() | - | ||||||
| 97 | { | - | ||||||
| 98 | } | - | ||||||
| 99 | - | |||||||
| 100 | void init(); | - | ||||||
| 101 | void resetInputMethod(); | - | ||||||
| 102 | void startCreatingCursor(); | - | ||||||
| 103 | void ensureVisible(int position, int preeditCursor = 0, int preeditLength = 0); | - | ||||||
| 104 | void updateHorizontalScroll(); | - | ||||||
| 105 | void updateVerticalScroll(); | - | ||||||
| 106 | bool determineHorizontalAlignment(); | - | ||||||
| 107 | bool setHAlign(QQuickTextInput::HAlignment, bool forceAlign = false); | - | ||||||
| 108 | void mirrorChange() override; | - | ||||||
| 109 | bool sendMouseEventToInputContext(QMouseEvent *event); | - | ||||||
| 110 | - | |||||||
| 111 | Qt::InputMethodHints effectiveInputMethodHints() const; | - | ||||||
| 112 | - | |||||||
| 113 | void handleFocusEvent(QFocusEvent *event); | - | ||||||
| 114 | - | |||||||
| 115 | struct MaskInputData { | - | ||||||
| 116 | enum Casemode { NoCaseMode, Upper, Lower }; | - | ||||||
| 117 | QChar maskChar; | - | ||||||
| 118 | bool separator; | - | ||||||
| 119 | Casemode caseMode; | - | ||||||
| 120 | }; | - | ||||||
| 121 | - | |||||||
| 122 | - | |||||||
| 123 | enum CommandType { Separator, Insert, Remove, Delete, RemoveSelection, DeleteSelection, SetSelection }; | - | ||||||
| 124 | struct Command { | - | ||||||
| 125 | inline Command() {} | - | ||||||
| 126 | inline Command(CommandType t, int p, QChar c, int ss, int se) : type(t),uc(c),pos(p),selStart(ss),selEnd(se) {} executed 5182 times by 1 test: end of blockExecuted by:
| 5182 | ||||||
| 127 | uint type : 4; | - | ||||||
| 128 | QChar uc; | - | ||||||
| 129 | int pos, selStart, selEnd; | - | ||||||
| 130 | }; | - | ||||||
| 131 | - | |||||||
| 132 | enum DrawFlags { | - | ||||||
| 133 | DrawText = 0x01, | - | ||||||
| 134 | DrawSelections = 0x02, | - | ||||||
| 135 | DrawCursor = 0x04, | - | ||||||
| 136 | DrawAll = DrawText | DrawSelections | DrawCursor | - | ||||||
| 137 | }; | - | ||||||
| 138 | - | |||||||
| 139 | QElapsedTimer tripleClickTimer; | - | ||||||
| 140 | QSizeF contentSize; | - | ||||||
| 141 | QPointF pressPos; | - | ||||||
| 142 | QPointF tripleClickStartPoint; | - | ||||||
| 143 | - | |||||||
| 144 | QPointer<QQmlComponent> cursorComponent; | - | ||||||
| 145 | - | |||||||
| 146 | QPointer<QValidator> m_validator; | - | ||||||
| 147 | - | |||||||
| 148 | - | |||||||
| 149 | qreal hscroll; | - | ||||||
| 150 | qreal vscroll; | - | ||||||
| 151 | - | |||||||
| 152 | QTextLayout m_textLayout; | - | ||||||
| 153 | QString m_text; | - | ||||||
| 154 | QString m_inputMask; | - | ||||||
| 155 | QString m_cancelText; | - | ||||||
| 156 | QFont font; | - | ||||||
| 157 | QFont sourceFont; | - | ||||||
| 158 | - | |||||||
| 159 | QQuickItem *cursorItem; | - | ||||||
| 160 | QQuickTextNode *textNode; | - | ||||||
| 161 | MaskInputData *m_maskData; | - | ||||||
| 162 | QInputControl *m_inputControl; | - | ||||||
| 163 | - | |||||||
| 164 | QList<int> m_transactions; | - | ||||||
| 165 | QVector<Command> m_history; | - | ||||||
| 166 | - | |||||||
| 167 | QColor color; | - | ||||||
| 168 | QColor selectionColor; | - | ||||||
| 169 | QColor selectedTextColor; | - | ||||||
| 170 | - | |||||||
| 171 | QBasicTimer m_passwordEchoTimer; | - | ||||||
| 172 | int lastSelectionStart; | - | ||||||
| 173 | int lastSelectionEnd; | - | ||||||
| 174 | int m_cursor; | - | ||||||
| 175 | - | |||||||
| 176 | int m_preeditCursor; | - | ||||||
| 177 | - | |||||||
| 178 | bool m_blinkEnabled; | - | ||||||
| 179 | int m_blinkTimer; | - | ||||||
| 180 | int m_maxLength; | - | ||||||
| 181 | int m_lastCursorPos; | - | ||||||
| 182 | int m_undoState; | - | ||||||
| 183 | int m_selstart; | - | ||||||
| 184 | int m_selend; | - | ||||||
| 185 | - | |||||||
| 186 | enum UpdateType { | - | ||||||
| 187 | UpdateNone, | - | ||||||
| 188 | UpdateOnlyPreprocess, | - | ||||||
| 189 | UpdatePaintNode | - | ||||||
| 190 | }; | - | ||||||
| 191 | - | |||||||
| 192 | - | |||||||
| 193 | Qt::InputMethodHints inputMethodHints; | - | ||||||
| 194 | - | |||||||
| 195 | QQuickTextInput::HAlignment hAlign; | - | ||||||
| 196 | QQuickTextInput::VAlignment vAlign; | - | ||||||
| 197 | QQuickTextInput::WrapMode wrapMode; | - | ||||||
| 198 | QQuickTextInput::EchoMode m_echoMode; | - | ||||||
| 199 | QQuickTextInput::RenderType renderType; | - | ||||||
| 200 | UpdateType updateType; | - | ||||||
| 201 | QQuickTextInput::SelectionMode mouseSelectionMode; | - | ||||||
| 202 | Qt::LayoutDirection m_layoutDirection; | - | ||||||
| 203 | - | |||||||
| 204 | QChar m_blank; | - | ||||||
| 205 | QChar m_passwordCharacter; | - | ||||||
| 206 | int m_passwordMaskDelay; | - | ||||||
| 207 | - | |||||||
| 208 | bool focusOnPress:1; | - | ||||||
| 209 | bool cursorVisible:1; | - | ||||||
| 210 | bool cursorPending:1; | - | ||||||
| 211 | bool autoScroll:1; | - | ||||||
| 212 | bool selectByMouse:1; | - | ||||||
| 213 | bool canPaste:1; | - | ||||||
| 214 | bool canPasteValid:1; | - | ||||||
| 215 | bool canUndo:1; | - | ||||||
| 216 | bool canRedo:1; | - | ||||||
| 217 | bool hAlignImplicit:1; | - | ||||||
| 218 | bool selectPressed:1; | - | ||||||
| 219 | bool textLayoutDirty:1; | - | ||||||
| 220 | bool persistentSelection:1; | - | ||||||
| 221 | bool hasImState : 1; | - | ||||||
| 222 | bool m_separator : 1; | - | ||||||
| 223 | bool m_readOnly : 1; | - | ||||||
| 224 | bool m_textDirty : 1; | - | ||||||
| 225 | - | |||||||
| 226 | bool m_preeditDirty : 1; | - | ||||||
| 227 | - | |||||||
| 228 | bool m_selDirty : 1; | - | ||||||
| 229 | bool m_validInput : 1; | - | ||||||
| 230 | bool m_acceptableInput : 1; | - | ||||||
| 231 | bool m_blinkStatus : 1; | - | ||||||
| 232 | bool m_passwordEchoEditing : 1; | - | ||||||
| 233 | bool inLayout:1; | - | ||||||
| 234 | bool requireImplicitWidth:1; | - | ||||||
| 235 | bool overwriteMode:1; | - | ||||||
| 236 | - | |||||||
| 237 | static inline QQuickTextInputPrivate *get(QQuickTextInput *t) { | - | ||||||
| 238 | return executed 6 times by 1 test: t->d_func();return t->d_func();Executed by:
executed 6 times by 1 test: return t->d_func();Executed by:
| 6 | ||||||
| 239 | } | - | ||||||
| 240 | bool hasPendingTripleClick() const { | - | ||||||
| 241 | return executed 74 times by 1 test: !tripleClickTimer.hasExpired(QGuiApplication::styleHints()->mouseDoubleClickInterval());return !tripleClickTimer.hasExpired(QGuiApplication::styleHints()->mouseDoubleClickInterval());Executed by:
executed 74 times by 1 test: return !tripleClickTimer.hasExpired(QGuiApplication::styleHints()->mouseDoubleClickInterval());Executed by:
| 74 | ||||||
| 242 | } | - | ||||||
| 243 | - | |||||||
| 244 | void setNativeCursorEnabled(bool) { | - | ||||||
| 245 | updateCursorBlinking(); | - | ||||||
| 246 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||
| 247 | - | |||||||
| 248 | int nextMaskBlank(int pos) | - | ||||||
| 249 | { | - | ||||||
| 250 | int c = findInMask(pos, true, false); | - | ||||||
| 251 | m_separator |= (c != pos); | - | ||||||
| 252 | return executed 764 times by 1 test: (c != -1 ? c : m_maxLength);return (c != -1 ? c : m_maxLength);Executed by:
executed 764 times by 1 test: return (c != -1 ? c : m_maxLength);Executed by:
| 764 | ||||||
| 253 | } | - | ||||||
| 254 | - | |||||||
| 255 | int prevMaskBlank(int pos) | - | ||||||
| 256 | { | - | ||||||
| 257 | int c = findInMask(pos, false, false); | - | ||||||
| 258 | m_separator |= (c != pos); | - | ||||||
| 259 | return executed 276 times by 1 test: (c != -1 ? c : 0);return (c != -1 ? c : 0);Executed by:
executed 276 times by 1 test: return (c != -1 ? c : 0);Executed by:
| 276 | ||||||
| 260 | } | - | ||||||
| 261 | - | |||||||
| 262 | bool isUndoAvailable() const { return executed 3900 times by 4 tests: !m_readOnly && m_undoState;return !m_readOnly && m_undoState;Executed by:
executed 3900 times by 4 tests: }return !m_readOnly && m_undoState;Executed by:
| 3900 | ||||||
| 263 | bool isRedoAvailable() const { return executed 3732 times by 4 tests: !m_readOnly && m_undoState < (int)m_history.size();return !m_readOnly && m_undoState < (int)m_history.size();Executed by:
executed 3732 times by 4 tests: }return !m_readOnly && m_undoState < (int)m_history.size();Executed by:
| 3732 | ||||||
| 264 | void clearUndo() { m_history.clear(); m_undoState = 0; } never executed: end of block | 0 | ||||||
| 265 | - | |||||||
| 266 | bool allSelected() const { return never executed: !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length();return !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length();never executed: }return !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length(); | 0 | ||||||
| 267 | bool hasSelectedText() const { return executed 13754 times by 4 tests: !m_text.isEmpty() && m_selend > m_selstart;return !m_text.isEmpty() && m_selend > m_selstart;Executed by:
executed 13754 times by 4 tests: }return !m_text.isEmpty() && m_selend > m_selstart;Executed by:
| 13754 | ||||||
| 268 | - | |||||||
| 269 | void setSelection(int start, int length); | - | ||||||
| 270 | - | |||||||
| 271 | inline QString selectedText() const { return executed 1010 times by 1 test: hasSelectedText() ? m_text.mid(m_selstart, m_selend - m_selstart) : QString();return hasSelectedText() ? m_text.mid(m_selstart, m_selend - m_selstart) : QString();Executed by:
executed 1010 times by 1 test: }return hasSelectedText() ? m_text.mid(m_selstart, m_selend - m_selstart) : QString();Executed by:
| 1010 | ||||||
| 272 | QString textBeforeSelection() const { return never executed: hasSelectedText() ? m_text.left(m_selstart) : QString();return hasSelectedText() ? m_text.left(m_selstart) : QString();never executed: }return hasSelectedText() ? m_text.left(m_selstart) : QString(); | 0 | ||||||
| 273 | QString textAfterSelection() const { return never executed: hasSelectedText() ? m_text.mid(m_selend) : QString();return hasSelectedText() ? m_text.mid(m_selend) : QString();never executed: }return hasSelectedText() ? m_text.mid(m_selend) : QString(); | 0 | ||||||
| 274 | - | |||||||
| 275 | int selectionStart() const { return executed 1975 times by 4 tests: hasSelectedText() ? m_selstart : -1;return hasSelectedText() ? m_selstart : -1;Executed by:
executed 1975 times by 4 tests: }return hasSelectedText() ? m_selstart : -1;Executed by:
| 1975 | ||||||
| 276 | int selectionEnd() const { return executed 1963 times by 4 tests: hasSelectedText() ? m_selend : -1;return hasSelectedText() ? m_selend : -1;Executed by:
executed 1963 times by 4 tests: }return hasSelectedText() ? m_selend : -1;Executed by:
| 1963 | ||||||
| 277 | - | |||||||
| 278 | QRectF anchorRectangle() const; | - | ||||||
| 279 | - | |||||||
| 280 | int positionAt(qreal x, qreal y, QTextLine::CursorPosition position) const; | - | ||||||
| 281 | int positionAt(const QPointF &point, QTextLine::CursorPosition position = QTextLine::CursorBetweenCharacters) const { | - | ||||||
| 282 | return executed 120 times by 1 test: positionAt(point.x(), point.y(), position);return positionAt(point.x(), point.y(), position);Executed by:
executed 120 times by 1 test: return positionAt(point.x(), point.y(), position);Executed by:
| 120 | ||||||
| 283 | } | - | ||||||
| 284 | - | |||||||
| 285 | void removeSelection() | - | ||||||
| 286 | { | - | ||||||
| 287 | int priorState = m_undoState; | - | ||||||
| 288 | removeSelectedText(); | - | ||||||
| 289 | finishChange(priorState); | - | ||||||
| 290 | } never executed: end of block | 0 | ||||||
| 291 | - | |||||||
| 292 | int start() const { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||
| 293 | int end() const { return executed 52 times by 2 tests: m_text.length();return m_text.length();Executed by:
executed 52 times by 2 tests: }return m_text.length();Executed by:
| 52 | ||||||
| 294 | - | |||||||
| 295 | QString realText() const; | - | ||||||
| 296 | - | |||||||
| 297 | - | |||||||
| 298 | void copy(QClipboard::Mode mode = QClipboard::Clipboard) const; | - | ||||||
| 299 | void paste(QClipboard::Mode mode = QClipboard::Clipboard); | - | ||||||
| 300 | - | |||||||
| 301 | - | |||||||
| 302 | - | |||||||
| 303 | void commitPreedit(); | - | ||||||
| 304 | void cancelPreedit(); | - | ||||||
| 305 | - | |||||||
| 306 | - | |||||||
| 307 | Qt::CursorMoveStyle cursorMoveStyle() const { return executed 2024 times by 2 tests: m_textLayout.cursorMoveStyle();return m_textLayout.cursorMoveStyle();Executed by:
executed 2024 times by 2 tests: }return m_textLayout.cursorMoveStyle();Executed by:
| 2024 | ||||||
| 308 | void setCursorMoveStyle(Qt::CursorMoveStyle style) { m_textLayout.setCursorMoveStyle(style); } never executed: end of block | 0 | ||||||
| 309 | - | |||||||
| 310 | void moveCursor(int pos, bool mark = false); | - | ||||||
| 311 | void cursorForward(bool mark, int steps) | - | ||||||
| 312 | { | - | ||||||
| 313 | int c = m_cursor; | - | ||||||
| 314 | if (steps > 0
| 30 | ||||||
| 315 | while (steps--
| 30 | ||||||
| 316 | c = cursorMoveStyle() == Qt::VisualMoveStyle
executed 30 times by 1 test: c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.rightCursorPosition(c) : m_textLayout.nextCursorPosition(c);Executed by:
| 0-30 | ||||||
| 317 | : m_textLayout.nextCursorPosition(c); executed 30 times by 1 test: c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.rightCursorPosition(c) : m_textLayout.nextCursorPosition(c);Executed by:
| 30 | ||||||
| 318 | } executed 30 times by 1 test: else if (steps < 0end of blockExecuted by:
| 0-30 | ||||||
| 319 | while (steps++
| 30 | ||||||
| 320 | c = cursorMoveStyle() == Qt::VisualMoveStyle
executed 30 times by 1 test: c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.leftCursorPosition(c) : m_textLayout.previousCursorPosition(c);Executed by:
| 0-30 | ||||||
| 321 | : m_textLayout.previousCursorPosition(c); executed 30 times by 1 test: c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.leftCursorPosition(c) : m_textLayout.previousCursorPosition(c);Executed by:
| 30 | ||||||
| 322 | } executed 30 times by 1 test: end of blockExecuted by:
| 30 | ||||||
| 323 | moveCursor(c, mark); | - | ||||||
| 324 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||
| 325 | - | |||||||
| 326 | void cursorWordForward(bool mark) { moveCursor(m_textLayout.nextCursorPosition(m_cursor, QTextLayout::SkipWords), mark); } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||
| 327 | void cursorWordBackward(bool mark) { moveCursor(m_textLayout.previousCursorPosition(m_cursor, QTextLayout::SkipWords), mark); } executed 18 times by 1 test: end of blockExecuted by:
| 18 | ||||||
| 328 | - | |||||||
| 329 | void home(bool mark) { moveCursor(0, mark); } executed 102 times by 1 test: end of blockExecuted by:
| 102 | ||||||
| 330 | void end(bool mark) { moveCursor(q_func()->text().length(), mark); } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||
| 331 | - | |||||||
| 332 | void backspace(); | - | ||||||
| 333 | void del(); | - | ||||||
| 334 | void deselect() { internalDeselect(); finishChange(); } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||
| 335 | void selectAll() { m_selstart = m_selend = m_cursor = 0; moveCursor(m_text.length(), true); } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||
| 336 | - | |||||||
| 337 | void insert(const QString &); | - | ||||||
| 338 | void clear(); | - | ||||||
| 339 | void selectWordAtPos(int); | - | ||||||
| 340 | - | |||||||
| 341 | void setCursorPosition(int pos) { if (pos <= m_text.length()
executed 38 times by 2 tests: }moveCursor(qMax(0, pos));Executed by:
executed 38 times by 2 tests: end of blockExecuted by:
| 0-38 | ||||||
| 342 | - | |||||||
| 343 | bool fixup(); | - | ||||||
| 344 | - | |||||||
| 345 | QString inputMask() const { return executed 622 times by 1 test: m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString();return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString();Executed by:
executed 622 times by 1 test: }return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString();Executed by:
| 622 | ||||||
| 346 | void setInputMask(const QString &mask) | - | ||||||
| 347 | { | - | ||||||
| 348 | parseInputMask(mask); | - | ||||||
| 349 | if (m_maskData
| 2-254 | ||||||
| 350 | moveCursor(nextMaskBlank(0)); executed 254 times by 1 test: moveCursor(nextMaskBlank(0));Executed by:
| 254 | ||||||
| 351 | } executed 256 times by 1 test: end of blockExecuted by:
| 256 | ||||||
| 352 | - | |||||||
| 353 | - | |||||||
| 354 | - | |||||||
| 355 | bool composeMode() const { return executed 208 times by 1 test: !m_textLayout.preeditAreaText().isEmpty();return !m_textLayout.preeditAreaText().isEmpty();Executed by:
executed 208 times by 1 test: }return !m_textLayout.preeditAreaText().isEmpty();Executed by:
| 208 | ||||||
| 356 | - | |||||||
| 357 | QString preeditAreaText() const { return executed 588 times by 1 test: m_textLayout.preeditAreaText();return m_textLayout.preeditAreaText();Executed by:
executed 588 times by 1 test: }return m_textLayout.preeditAreaText();Executed by:
| 588 | ||||||
| 358 | - | |||||||
| 359 | - | |||||||
| 360 | void updatePasswordEchoEditing(bool editing); | - | ||||||
| 361 | - | |||||||
| 362 | void cancelPasswordEchoTimer() { | - | ||||||
| 363 | m_passwordEchoTimer.stop(); | - | ||||||
| 364 | } executed 486 times by 1 test: end of blockExecuted by:
| 486 | ||||||
| 365 | - | |||||||
| 366 | Qt::LayoutDirection textDirection() const; | - | ||||||
| 367 | Qt::LayoutDirection layoutDirection() const; | - | ||||||
| 368 | void setLayoutDirection(Qt::LayoutDirection direction) | - | ||||||
| 369 | { | - | ||||||
| 370 | if (direction != m_layoutDirection
| 0-58 | ||||||
| 371 | m_layoutDirection = direction; | - | ||||||
| 372 | updateDisplayText(); | - | ||||||
| 373 | } executed 58 times by 1 test: end of blockExecuted by:
| 58 | ||||||
| 374 | } executed 58 times by 1 test: end of blockExecuted by:
| 58 | ||||||
| 375 | - | |||||||
| 376 | - | |||||||
| 377 | void processInputMethodEvent(QInputMethodEvent *event); | - | ||||||
| 378 | - | |||||||
| 379 | void processKeyEvent(QKeyEvent* ev); | - | ||||||
| 380 | - | |||||||
| 381 | void setBlinkingCursorEnabled(bool enable); | - | ||||||
| 382 | void updateCursorBlinking(); | - | ||||||
| 383 | - | |||||||
| 384 | void updateLayout(); | - | ||||||
| 385 | void updateBaselineOffset(); | - | ||||||
| 386 | - | |||||||
| 387 | qreal getImplicitWidth() const override; | - | ||||||
| 388 | - | |||||||
| 389 | inline qreal padding() const { return executed 71678 times by 5 tests: extra.isAllocated() ? extra->padding : 0.0;return extra.isAllocated() ? extra->padding : 0.0;Executed by:
executed 71678 times by 5 tests: }return extra.isAllocated() ? extra->padding : 0.0;Executed by:
| 71678 | ||||||
| 390 | void setTopPadding(qreal value, bool reset = false); | - | ||||||
| 391 | void setLeftPadding(qreal value, bool reset = false); | - | ||||||
| 392 | void setRightPadding(qreal value, bool reset = false); | - | ||||||
| 393 | void setBottomPadding(qreal value, bool reset = false); | - | ||||||
| 394 | - | |||||||
| 395 | bool isImplicitResizeEnabled() const; | - | ||||||
| 396 | void setImplicitResizeEnabled(bool enabled); | - | ||||||
| 397 | - | |||||||
| 398 | private: | - | ||||||
| 399 | void removeSelectedText(); | - | ||||||
| 400 | void internalSetText(const QString &txt, int pos = -1, bool edited = true); | - | ||||||
| 401 | void updateDisplayText(bool forceUpdate = false); | - | ||||||
| 402 | - | |||||||
| 403 | void internalInsert(const QString &s); | - | ||||||
| 404 | void internalDelete(bool wasBackspace = false); | - | ||||||
| 405 | void internalRemove(int pos); | - | ||||||
| 406 | - | |||||||
| 407 | inline void internalDeselect() | - | ||||||
| 408 | { | - | ||||||
| 409 | m_selDirty |= (m_selend > m_selstart); | - | ||||||
| 410 | m_selstart = m_selend = 0; | - | ||||||
| 411 | } executed 3312 times by 4 tests: end of blockExecuted by:
| 3312 | ||||||
| 412 | - | |||||||
| 413 | void internalUndo(int until = -1); | - | ||||||
| 414 | void internalRedo(); | - | ||||||
| 415 | void emitUndoRedoChanged(); | - | ||||||
| 416 | - | |||||||
| 417 | bool emitCursorPositionChanged(); | - | ||||||
| 418 | - | |||||||
| 419 | bool finishChange(int validateFromState = -1, bool update = false, bool edited = true); | - | ||||||
| 420 | - | |||||||
| 421 | void addCommand(const Command& cmd); | - | ||||||
| 422 | - | |||||||
| 423 | inline void separate() { m_separator = true; } executed 1626 times by 1 test: end of blockExecuted by:
| 1626 | ||||||
| 424 | - | |||||||
| 425 | bool separateSelection(); | - | ||||||
| 426 | void deleteStartOfWord(); | - | ||||||
| 427 | void deleteEndOfWord(); | - | ||||||
| 428 | void deleteEndOfLine(); | - | ||||||
| 429 | - | |||||||
| 430 | enum ValidatorState { | - | ||||||
| 431 | - | |||||||
| 432 | InvalidInput = QValidator::Invalid, | - | ||||||
| 433 | IntermediateInput = QValidator::Intermediate, | - | ||||||
| 434 | AcceptableInput = QValidator::Acceptable | - | ||||||
| 435 | - | |||||||
| 436 | - | |||||||
| 437 | - | |||||||
| 438 | - | |||||||
| 439 | - | |||||||
| 440 | }; | - | ||||||
| 441 | - | |||||||
| 442 | - | |||||||
| 443 | void parseInputMask(const QString &maskFields); | - | ||||||
| 444 | bool isValidInput(QChar key, QChar mask) const; | - | ||||||
| 445 | ValidatorState hasAcceptableInput(const QString &text) const; | - | ||||||
| 446 | void checkIsValid(); | - | ||||||
| 447 | QString maskString(uint pos, const QString &str, bool clear = false) const; | - | ||||||
| 448 | QString clearString(uint pos, uint len) const; | - | ||||||
| 449 | QString stripString(const QString &str) const; | - | ||||||
| 450 | int findInMask(int pos, bool forward, bool findSeparator, QChar searchChar = QChar()) const; | - | ||||||
| 451 | }; | - | ||||||
| 452 | - | |||||||
| 453 | - | |||||||
| Switch to Source code | Preprocessed file |