From 1c26beaf3ad0cad93dcd9bc6ad36445a94ffe608 Mon Sep 17 00:00:00 2001 From: Simon Perret Date: Fri, 26 Jul 2024 15:40:19 +0200 Subject: [PATCH] fix: improve script performance by changing QTreeView settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch determine the height of a row in history panel only once at the beginning and does not resize the width of the first column for each new log. Column resizing will now be done manually by the user to gain performance during execution. For example, for the mfc_update_translations_qml script: - before the patch: ≈80000ms - after the patch: ≈500ms --- src/gui/historypanel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/historypanel.cpp b/src/gui/historypanel.cpp index 6bded12e..1e63530e 100644 --- a/src/gui/historypanel.cpp +++ b/src/gui/historypanel.cpp @@ -28,10 +28,9 @@ HistoryPanel::HistoryPanel(QWidget *parent) { setWindowTitle(tr("History")); setObjectName("HistoryPanel"); - + setUniformRowHeights(true); setModel(m_model); header()->setStretchLastSection(true); - header()->setSectionResizeMode(Core::HistoryModel::NameCol, QHeaderView::ResizeToContents); auto showLast = [this]() { scrollTo(m_model->index(m_model->rowCount() - 1, 0));