When I try to add a big QString (size:104806123) to a QPlainTextEdit I get an exception :C++: std::bad_alloc
void LogFileialog::add(QString &logLine)
{
ui.log_plainTextEdit->appendPlainText(logLine);
}
I also tried to append the Text to the QPlainTextEdit splitting the data in many QStrings:
for (int i = 0; i < blockNumber; i++)
ui.log_plainTextEdit->appendPlainText(logLine[i]);
but around at 570.000 row iI get the std::bad_alloc. The problem not is in QString, but when I call appendPlainText(QString)
There is a better way to add a Big String to a QPlainTextEdit ?