mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
#1925 Tree Selection Editor : Do not change toggle state if list is empty
This commit is contained in:
1 parent
cfa0bee252
commit
f2d32a5833
1 file changed
+9
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user