MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateCode

Method updateCode

src/plugins/chat/widgets/codeeditcomponent.cpp:80–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void CodeEditComponent::updateCode(const QString &code, const QString &language)
81{
82 updateDefinition(language);
83 if (codeEdit) {
84 codeEdit->setPlainText(code);
85 if (heightUpdate) {
86 QTextDocument *doc = codeEdit->document();
87 qreal height = doc->lineCount() * codeEdit->fontMetrics().height();
88 height += 15;
89 codeEdit->setFixedHeight(static_cast<int>(height));
90 }
91 }
92}
93
94void CodeEditComponent::updateCode(const QStringList &codeLines, const QString &language)
95{

Callers 1

updateMessageMethod · 0.80

Calls 2

documentMethod · 0.45
lineCountMethod · 0.45

Tested by

no test coverage detected