#2286 AppFwk TreeSelection Editor : Always cache option items, rebuild tree when count changes

This commit is contained in:
Magne Sjaastad 2017-12-21 11:58:26 +01:00
parent 5ecedb7a30
commit 2ed7d74bbd

View File

@ -151,12 +151,14 @@ void caf::PdmUiTreeSelectionQModel::setOptions(caf::PdmUiFieldEditorHandle* fiel
{ {
m_uiFieldHandle = field; m_uiFieldHandle = field;
if (m_options.size() != options.size()) bool mustRebuildOptionItemTree = m_options.size() != options.size();
m_options = options;
if (mustRebuildOptionItemTree)
{ {
beginResetModel(); beginResetModel();
m_options = options;
if (m_tree) if (m_tree)
{ {
delete m_tree; delete m_tree;