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>bb10
parent
7cea5949ca
commit
f6eb3c220b
|
|
@ -2153,10 +2153,11 @@ QVariant QTreeWidgetItem::childrenCheckState(int column) const
|
|||
default:
|
||||
return Qt::PartiallyChecked;
|
||||
}
|
||||
|
||||
if (uncheckedChildren && checkedChildren)
|
||||
return Qt::PartiallyChecked;
|
||||
}
|
||||
|
||||
if (uncheckedChildren && checkedChildren)
|
||||
return Qt::PartiallyChecked;
|
||||
if (uncheckedChildren)
|
||||
return Qt::Unchecked;
|
||||
else if (checkedChildren)
|
||||
|
|
|
|||
Loading…
Reference in New Issue