diff --git a/src/Gui/DlgObjectSelection.cpp b/src/Gui/DlgObjectSelection.cpp index f1783736db..375f324deb 100644 --- a/src/Gui/DlgObjectSelection.cpp +++ b/src/Gui/DlgObjectSelection.cpp @@ -243,6 +243,8 @@ void DlgObjectSelection::updateAllItemState() } if (count && count == (int)itemMap.size()) allItem->setCheckState(0, Qt::Checked); + else if (!count) + allItem->setCheckState(0, Qt::Unchecked); } void DlgObjectSelection::setItemState(App::DocumentObject *obj, @@ -450,7 +452,7 @@ void DlgObjectSelection::checkItemChanged() { std::set unchecked; - for (auto &v : itemChanged) { + for (const auto &v : itemChanged) { const auto &objT = v.first; Qt::CheckState state = v.second; if (auto obj = objT.getObject()) { @@ -486,7 +488,7 @@ void DlgObjectSelection::checkItemChanged() { std::sort(outlist.begin(), outlist.end()); for (const auto &v : itemMap) { - if (v.second[0]->checkState(0) == Qt::Unchecked) + if (itemChanged.count(v.first) == 0 && v.second[0]->checkState(0) == Qt::Unchecked) continue; if (auto obj = v.first.getObject()) { if (!std::binary_search(outlist.begin(), outlist.end(), obj))