| 78 | } |
| 79 | |
| 80 | void 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 | |
| 94 | void CodeEditComponent::updateCode(const QStringList &codeLines, const QString &language) |
| 95 | { |
no test coverage detected