MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / cursorBeyond

Function cursorBeyond

src/Gui/PythonConsole.cpp:74–82  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

72 * @return true if a keyEvent is ok at cursor's position, false otherwise
73 */
74inline 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
84struct PythonConsoleP
85{

Callers 3

keyPressEventMethod · 0.85
dropEventMethod · 0.85
contextMenuEventMethod · 0.85

Calls 2

positionMethod · 0.45
hasSelectionMethod · 0.45

Tested by

no test coverage detected