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

Method frame

lib/QCodeEditor/src/internal/QFramedTextAttribute.cpp:64–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void QFramedTextAttribute::frame(QTextCursor cursor)
65{
66 auto text = cursor.document()->findBlockByNumber(cursor.blockNumber()).text();
67
68 QTextCharFormat format;
69 format.setObjectType(type());
70 format.setProperty(FramedString, cursor.selectedText());
71
72 if (cursor.selectionEnd() > cursor.selectionStart())
73 {
74 cursor.setPosition(cursor.selectionStart());
75 }
76 else
77 {
78 cursor.setPosition(cursor.selectionEnd());
79 }
80
81 cursor.insertText(QString(QChar::ObjectReplacementCharacter), format);
82}
83
84void QFramedTextAttribute::clear(QTextCursor cursor)
85{

Callers 4

handleSelectionQueryMethod · 0.80
resetDataMethod · 0.80

Calls 2

selectedTextMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected