C++ (Qt) QTextDocument *doc = new QTextDocument(); QTextCursor cursor(doc); cursor.insertHtml(ui->textEdit->toHtml() + ui->textEdit_2->toHtml());