MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / charUnderCursor

Method charUnderCursor

lib/QCodeEditor/src/internal/QCodeEditor.cpp:717–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717QChar QCodeEditor::charUnderCursor(int offset) const
718{
719 auto block = textCursor().blockNumber();
720 auto index = textCursor().positionInBlock();
721 auto text = document()->findBlockByNumber(block).text();
722
723 index += offset;
724
725 if (index < 0 || index >= text.size())
726 {
727 return {};
728 }
729
730 return text[index];
731}
732
733QString QCodeEditor::wordUnderCursor() const
734{

Callers

nothing calls this directly

Calls 2

textMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected