QTreeWidget: optimize childrenCheckState
When we met at least one checked child and at least one unchecked child return immediately PartiallyChecked state (no need to check other children state). Change-Id: I17ec07a925667231a1d809695f347a0f3cfffa0e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
7cea5949ca
commit
f6eb3c220b
@ -2153,10 +2153,11 @@ QVariant QTreeWidgetItem::childrenCheckState(int column) const
|
|||||||
default:
|
default:
|
||||||
return Qt::PartiallyChecked;
|
return Qt::PartiallyChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uncheckedChildren && checkedChildren)
|
||||||
|
return Qt::PartiallyChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uncheckedChildren && checkedChildren)
|
|
||||||
return Qt::PartiallyChecked;
|
|
||||||
if (uncheckedChildren)
|
if (uncheckedChildren)
|
||||||
return Qt::Unchecked;
|
return Qt::Unchecked;
|
||||||
else if (checkedChildren)
|
else if (checkedChildren)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user