Hi,
I am trying to create an interface where the user types a "shell command" on a QLineEdit. I process this command and dump the output to a "shell output" which is a QPlainTextEdit. I have the basic code shown below. But this keeps overwriting the first line on QPlainTextEdit. I want to keep appending to the buffer (so as to a get some sort of a "log"). Rather than appending to a QString, I tried advancing the cursor to the end of line, but that doesn't seem to work. It keeps overwriting on the same line. Can someone tell me what I'm doing wrong?
Thanks
void RelosMainWindow::have_shellinput()
{
ui->shell_output->setPlainText(ui->shell_input->text() + "\n");
ui->shell_input->clear();
qDebug() << ui->shell_output->overwriteMode();
}
void RelosMainWindow::have_shellinput()
{
ui->shell_output->setPlainText(ui->shell_input->text() + "\n");
ui->shell_output->moveCursor(QTextCursor::EndOfLine);
ui->shell_input->clear();
qDebug() << ui->shell_output->overwriteMode();
}
To copy to clipboard, switch view to plain text mode
Bookmarks