mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1925 Tree Selection Editor : Do not change toggle state if list is empty
This commit is contained in:
parent
cfa0bee252
commit
f2d32a5833
@ -191,17 +191,20 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
else
|
||||
{
|
||||
bool allItemsChecked = true;
|
||||
QModelIndexList indices = allVisibleSourceModelIndices();
|
||||
for (auto mi : indices)
|
||||
if (indices.size() > 0)
|
||||
{
|
||||
if (m_model->data(mi, Qt::CheckStateRole).toBool() == false)
|
||||
bool allItemsChecked = true;
|
||||
for (auto mi : indices)
|
||||
{
|
||||
allItemsChecked = false;
|
||||
if (m_model->data(mi, Qt::CheckStateRole).toBool() == false)
|
||||
{
|
||||
allItemsChecked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_toggleAllCheckBox->setChecked(allItemsChecked);
|
||||
m_toggleAllCheckBox->setChecked(allItemsChecked);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user