diff options
author | Katja Marttila <katja.marttila@qt.io> | 2022-03-25 15:38:50 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2022-04-28 15:18:34 +0300 |
commit | a28cf55b5a5007c0dd952b3012c076d9da329f0f (patch) | |
tree | aba86d92da394969acfcf2eb6d7b7578c9432c36 /src/libs/installer/componentselectionpage_p.cpp | |
parent | 23ec1e91f4e0c567f5953de149b2ab3496490e87 (diff) |
Speed up component selection in component selection pages
If a lot of components are installed, maintenancetool was slow to
select/unselect a single component. This was caused because the whole
tree's components were recalculated. Fixed so that only the
selected/unselected components and their dependencies and
autodependencies are recalculated instead of whole tree.
This change speeds up clicking tree item from zero to 90 percent,
depending on how much components are already installed. The more
components are installed as autodependency, the slower it gets to
select the items.
Task-number: QTIFW-2522
Change-Id: I5e824aed8787fd7ecdce72b15a1b13848f0a3923
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/componentselectionpage_p.cpp')
-rw-r--r-- | src/libs/installer/componentselectionpage_p.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index e775c0cb4..5e44d153c 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -185,10 +185,16 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP m_stackedLayout->addWidget(progressStackedWidget); m_stackedLayout->setCurrentIndex(0); - connect(m_allModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), this, - SLOT(onModelStateChanged(QInstaller::ComponentModel::ModelState))); - connect(m_updaterModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), - this, SLOT(onModelStateChanged(QInstaller::ComponentModel::ModelState))); + connect(m_allModel, &ComponentModel::modelCheckStateChanged, + this, &ComponentSelectionPagePrivate::onModelStateChanged); + connect(m_updaterModel, &ComponentModel::modelCheckStateChanged, + this, &ComponentSelectionPagePrivate::onModelStateChanged); + + connect(m_allModel, &ComponentModel::componentsCheckStateChanged, this, + [=]() { onModelStateChanged(m_allModel->checkedState());}); + + connect(m_updaterModel, &ComponentModel::componentsCheckStateChanged, this, + [=]() { onModelStateChanged(m_allModel->checkedState());}); connect(m_core, SIGNAL(metaJobProgress(int)), this, SLOT(onProgressChanged(int))); connect(m_core, SIGNAL(metaJobInfoMessage(QString)), this, SLOT(setMessage(QString))); |