#include "plaintextrenderer.hpp" #include #include std::unique_ptr PlainTextRenderer::render(const QByteArray &input, const DocumentStyle &style) { QTextCharFormat standard; standard.setFont(style.preformatted_font); standard.setForeground(style.preformatted_color); std::unique_ptr result = std::make_unique(); result->setDocumentMargin(style.margin); QTextCursor cursor { result.get() }; cursor.insertText(QString::fromUtf8(input), standard); return result; }