forked from qt-creator/qt-creator
AutoTest: Fix checkstate evaluation
When the last item of a test got modified and gets a different state than the rest of its siblings we failed to set the resulting state of its parent to partially checked. Fixes: QTCREATORBUG-25702 Change-Id: I122b77b907dfa7fd14c31d8363b025254e0c115e Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -623,10 +623,6 @@ static Qt::CheckState computeCheckStateByChildren(ITestTreeItem *item)
|
||||
bool foundPartiallyChecked = false;
|
||||
|
||||
item->forFirstLevelChildren([&](ITestTreeItem *child) {
|
||||
if (foundPartiallyChecked || (foundChecked && foundUnchecked)) {
|
||||
newState = Qt::PartiallyChecked;
|
||||
return;
|
||||
}
|
||||
switch (child->type()) {
|
||||
case TestTreeItem::TestDataFunction:
|
||||
case TestTreeItem::TestSpecialFunction:
|
||||
@@ -638,6 +634,11 @@ static Qt::CheckState computeCheckStateByChildren(ITestTreeItem *item)
|
||||
foundChecked |= (child->checked() == Qt::Checked);
|
||||
foundUnchecked |= (child->checked() == Qt::Unchecked);
|
||||
foundPartiallyChecked |= (child->checked() == Qt::PartiallyChecked);
|
||||
|
||||
if (foundPartiallyChecked || (foundChecked && foundUnchecked)) {
|
||||
newState = Qt::PartiallyChecked;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (newState != Qt::PartiallyChecked)
|
||||
|
Reference in New Issue
Block a user