forked from qt-creator/qt-creator
AutoTest: Provide 'Uncheck All' for filters
'Check All' is provided since filtering is possible, so provide the opposite as well to avoid unnecessary clicks. Change-Id: Id7b695e79e8ce57a6548a8581205cafdad2b2cb9 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -444,11 +444,12 @@ void TestResultsPane::initializeFilterMenu()
|
||||
m_filterMenu->addAction(action);
|
||||
}
|
||||
m_filterMenu->addSeparator();
|
||||
QAction *action = new QAction(m_filterMenu);
|
||||
action->setText(tr("Check All Filters"));
|
||||
action->setCheckable(false);
|
||||
QAction *action = new QAction(tr("Check All Filters"), m_filterMenu);
|
||||
m_filterMenu->addAction(action);
|
||||
connect(action, &QAction::triggered, this, &TestResultsPane::enableAllFilter);
|
||||
connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(true); });
|
||||
action = new QAction(tr("Uncheck All Filters"), m_filterMenu);
|
||||
m_filterMenu->addAction(action);
|
||||
connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(false); });
|
||||
}
|
||||
|
||||
void TestResultsPane::updateSummaryLabel()
|
||||
@@ -478,11 +479,11 @@ void TestResultsPane::updateSummaryLabel()
|
||||
m_summaryLabel->setText(labelText);
|
||||
}
|
||||
|
||||
void TestResultsPane::enableAllFilter()
|
||||
void TestResultsPane::checkAllFilter(bool checked)
|
||||
{
|
||||
for (QAction *action : m_filterMenu->actions()) {
|
||||
if (action->isCheckable())
|
||||
action->setChecked(true);
|
||||
action->setChecked(checked);
|
||||
}
|
||||
m_filterModel->enableAllResultTypes();
|
||||
}
|
||||
|
@@ -101,7 +101,7 @@ private:
|
||||
void onItemActivated(const QModelIndex &index);
|
||||
void onRunAllTriggered();
|
||||
void onRunSelectedTriggered();
|
||||
void enableAllFilter();
|
||||
void checkAllFilter(bool checked);
|
||||
void filterMenuTriggered(QAction *action);
|
||||
|
||||
void initializeFilterMenu();
|
||||
|
Reference in New Issue
Block a user