Optimazation of tree view when clearing selection

This commit is contained in:
wmayer 2012-11-08 23:06:07 +01:00
parent efe4fc3b08
commit 951a45f90e

View File

@ -985,9 +985,12 @@ void DocumentItem::setObjectSelected(const char* name, bool select)
void DocumentItem::clearSelection(void)
{
// Block signals here otherwise we get a recursion and quadratic runtime
bool ok = treeWidget()->blockSignals(true);
for (std::map<std::string,DocumentObjectItem*>::iterator pos = ObjectMap.begin();pos!=ObjectMap.end();++pos) {
treeWidget()->setItemSelected(pos->second, false);
pos->second->setSelected(false);
}
treeWidget()->blockSignals(ok);
}
void DocumentItem::updateSelection(void)