This question has already been answered:
- C ++ compiler error 1 response
I have too large text and therefore gives error C1091: compiler limit: string exceeds 65535 bytes in length. I decided to split this line into two parts and put in qtextedit? That is, I have:
QTextEdit* TextEdit = new QTextEdit("...<P ALIGN=JUSTIFY STYLE=\"margin-bottom: 0.14in\"><BR><BR>" "</P>" "<P ALIGN=JUSTIFY STYLE=\"margin-bottom: 0.14in\"><BR><BR>" "</P>..."); QTextEdit* TextEditOne = new QTextEdit("...<P>Какой то текст</P>..."; How do I take two pieces of text from two QTextEdit and write to one file? I do this:
QString fileName = QFileDialog::getSaveFileName(this, tr("Файл ODT"),"",tr("Файлы ODT (*.odt)")); if (fileName.isEmpty()) return; QTextDocumentWriter writer(fileName); QTextDocument *m_document = new QTextDocument(); bool success; m_document=TextEdit->document(); m_document+=TextEditOne->document(); success = writer.write(m_document); if (success) { QMessageBox::information(this, "Отлично!", "Экспорт прошел успешно"); } else { QMessageBox::critical(this, "Ошибка", "При сохранении файла произошла ошибка"); } But I constantly get a message that pops up: An error occurred while saving the file