Move delete buttons to the same line & set model to nullptr before adding lines

Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
Yihe Li
2025-04-15 20:22:21 +08:00
parent de66fe4eda
commit 521302a962
2 changed files with 17 additions and 14 deletions

View File

@ -204,6 +204,7 @@ void OtherLogsPage::on_btnReload_clicked()
if (content.back() == '\n')
content = content.remove(content.size() - 1, 1);
ui->text->clear();
ui->text->setModel(nullptr);
m_model->clear();
for (auto& line : content.split('\n')) {
MessageLevel::Enum level = MessageLevel::Unknown;
@ -221,6 +222,8 @@ void OtherLogsPage::on_btnReload_clicked()
m_model->append(level, line);
}
ui->text->setModel(m_proxy);
ui->text->scrollToBottom();
}
}