diff options
author | Christian Stenger <christian.stenger@qt.io> | 2020-11-06 13:24:06 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2020-11-16 08:33:40 +0000 |
commit | bf8eb2d270f62d3796c2004aa777db4a3f9136f9 (patch) | |
tree | 6a036485a970b57416c9890a9a87cfe886c1ed7e /src | |
parent | c2b6d4567036d7be3946345d3b9e3b154eb2ba0f (diff) |
AutoTest: Fix using of cache
Change-Id: I3f7695c96139c1f1809631ead1b723e3820b240d
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/autotest/testnavigationwidget.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index 31b0c6749b..4a6aa7c0c0 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -116,6 +116,8 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) : this, &TestNavigationWidget::reapplyCachedExpandedState); connect(m_progressTimer, &QTimer::timeout, m_progressIndicator, &Utils::ProgressIndicator::show); + connect(m_view, &TestTreeView::expanded, this, &TestNavigationWidget::updateExpandedStateCache); + connect(m_view, &TestTreeView::collapsed, this, &TestNavigationWidget::updateExpandedStateCache); } void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) @@ -226,8 +228,18 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons() collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon()); collapse->setToolTip(tr("Collapse All")); - connect(expand, &QToolButton::clicked, m_view, &TestTreeView::expandAll); - connect(collapse, &QToolButton::clicked, m_view, &TestTreeView::collapseAll); + connect(expand, &QToolButton::clicked, m_view, [this]() { + m_view->blockSignals(true); + m_view->expandAll(); + m_view->blockSignals(false); + updateExpandedStateCache(); + }); + connect(collapse, &QToolButton::clicked, m_view, [this]() { + m_view->blockSignals(true); + m_view->collapseAll(); + m_view->blockSignals(false); + updateExpandedStateCache(); + }); connect(m_sort, &QToolButton::clicked, this, &TestNavigationWidget::onSortClicked); list << m_filterButton << m_sort << expand << collapse; |