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:
jkobus 2014-11-19 15:45:41 +01:00 committed by Jarek Kobus
parent 7cea5949ca
commit f6eb3c220b

View File

@ -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)