in this question i asked how to split text by whitespace, now i split it, but now i can’t display this text in QTextEdit.
I make so:
QStringList list = line.split(QRegExp("\\s+"));
for (int i = 0; i < list.count(); i++){
table.push_back(list[i]);
this->ui->textEdit->setText(table[i]); //output text in qtextedit
}
But i see clean textedit after that. But if i make for example:
this->ui->textEdit->setText(table[2]);
I see third word in QTextEdit. What’s wrong?
Thank you.
What type is
table?setTextonly takes a QString, which means you’ll need to build a big string of your split string elements and set the Text to that.Alternatively, you could clear the QTextEdit and append every string in
table.