Skip to content

Commit

Permalink
fix: improve script performance by changing QTreeView settings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
smnppKDAB authored and LeonMatthesKDAB committed Jul 29, 2024
1 parent 308e7ba commit 1c26bea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gui/historypanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 1c26bea

Please sign in to comment.