AutoTest: Fix using of cache

Change-Id: I3f7695c96139c1f1809631ead1b723e3820b240d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-11-06 13:24:06 +01:00
parent c2b6d45670
commit bf8eb2d270

View File

@@ -116,6 +116,8 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
this, &TestNavigationWidget::reapplyCachedExpandedState); this, &TestNavigationWidget::reapplyCachedExpandedState);
connect(m_progressTimer, &QTimer::timeout, connect(m_progressTimer, &QTimer::timeout,
m_progressIndicator, &Utils::ProgressIndicator::show); 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) void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
@@ -226,8 +228,18 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons()
collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon()); collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon());
collapse->setToolTip(tr("Collapse All")); collapse->setToolTip(tr("Collapse All"));
connect(expand, &QToolButton::clicked, m_view, &TestTreeView::expandAll); connect(expand, &QToolButton::clicked, m_view, [this]() {
connect(collapse, &QToolButton::clicked, m_view, &TestTreeView::collapseAll); 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); connect(m_sort, &QToolButton::clicked, this, &TestNavigationWidget::onSortClicked);
list << m_filterButton << m_sort << expand << collapse; list << m_filterButton << m_sort << expand << collapse;