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

Method appendOutput

src/Gui/PythonConsole.cpp:790–806  ·  view source on GitHub ↗

* Appends \a output to the console and set \a state as user state to * the text block which is needed for the highlighting. */

Source from the content-addressed store, hash-verified

788 * the text block which is needed for the highlighting.
789 */
790void PythonConsole::appendOutput(const QString& output, int state)
791{
792 QTextCursor cursor = textCursor();
793 cursor.movePosition(QTextCursor::End);
794 int pos = cursor.position() + 1;
795
796 // delay rehighlighting
797 cursor.beginEditBlock();
798 appendPlainText(output);
799
800 QTextBlock block = this->document()->findBlock(pos);
801 while (block.isValid()) {
802 block.setUserState(state);
803 block = block.next();
804 }
805 cursor.endEditBlock(); // start highlightiong
806}
807
808/**
809 * Builds up the Python command and pass it to the interpreter.

Callers

nothing calls this directly

Calls 4

positionMethod · 0.45
documentMethod · 0.45
isValidMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected