* cursorBeyond checks if cursor is at a valid position to accept keyEvents. * @param cursor - cursor to check * @param limit - cursor that marks the begin of the input region * @param shift - offset for shifting the limit for non-selection cursors [default: 0] * @return true if a keyEvent is ok at cursor's position, false otherwise */
| 72 | * @return true if a keyEvent is ok at cursor's position, false otherwise |
| 73 | */ |
| 74 | inline bool cursorBeyond(const QTextCursor& cursor, const QTextCursor& limit, int shift = 0) |
| 75 | { |
| 76 | int pos = limit.position(); |
| 77 | if (cursor.hasSelection()) { |
| 78 | return (cursor.selectionStart() >= pos && cursor.selectionEnd() >= pos); |
| 79 | } |
| 80 | |
| 81 | return cursor.position() >= (pos + shift); |
| 82 | } |
| 83 | |
| 84 | struct PythonConsoleP |
| 85 | { |
no test coverage detected