From e28e316f6fc364953a6f14bf0433044d942251b6 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 20 Jan 2021 22:11:30 +0100 Subject: Fix empty loglist after startup. --- src/mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a79aca2f..5b4e87ab 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1209,8 +1209,12 @@ void MainWindow::showEvent(QShowEvent *event) m_WasVisible = true; updateProblemsButton(); - // Notify plugin that the MO2 is ready: + // notify plugins that the MO2 is ready m_PluginContainer.startPlugins(this); + + // forces a log list refresh to display startup logs + ui->logList->reset(); + ui->logList->scrollToBottom(); } } -- cgit v1.3.1 From 2ed3d4696b49f28fb39d4656113db3e45e3f9add Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Thu, 21 Jan 2021 19:11:37 +0100 Subject: Add comment to explain the reset() on the log list. --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5b4e87ab..a25406dd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1213,6 +1213,15 @@ void MainWindow::showEvent(QShowEvent *event) m_PluginContainer.startPlugins(this); // forces a log list refresh to display startup logs + // + // since the log list is not visible until this point, the automatic + // resize of columns seems to break the log list (since Qt 5.15.1 or + // 5.15.2), an make the list empty on startup (in debug the list is not + // empty because some logs are added after the log list becomes visible) + // + // the reset() forces a re-computation of the column size, thus properly + // the logs that are already in the log model + // ui->logList->reset(); ui->logList->scrollToBottom(); } -- cgit v1.3.1