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

Method inputBegin

src/Gui/PythonConsole.cpp:1175–1188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1173}
1174
1175QTextCursor PythonConsole::inputBegin() const
1176{
1177 // construct cursor at begin of input line ...
1178 QTextCursor inputLineBegin(this->textCursor());
1179 inputLineBegin.movePosition(QTextCursor::End);
1180 inputLineBegin.movePosition(QTextCursor::StartOfBlock);
1181 // ... and move cursor right beyond the prompt.
1182 int prompt = promptLength(inputLineBegin.block().text());
1183 if (this->_sourceDrain && !this->_sourceDrain->isEmpty()) {
1184 prompt = this->_sourceDrain->length();
1185 }
1186 inputLineBegin.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, prompt);
1187 return inputLineBegin;
1188}
1189
1190QMimeData* PythonConsole::createMimeDataFromSelection() const
1191{

Callers 5

keyPressEventMethod · 0.95
mouseReleaseEventMethod · 0.95
dropEventMethod · 0.95
overrideCursorMethod · 0.95
contextMenuEventMethod · 0.95

Calls 6

promptLengthFunction · 0.85
blockMethod · 0.80
textCursorMethod · 0.45
textMethod · 0.45
isEmptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected