Gui: fix DlgObjectSelection item state synchronization
This commit is contained in:
@@ -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<App::DocumentObject*> 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))
|
||||
|
||||
Reference in New Issue
Block a user