#1895 Curve Creator : Added documentation

This commit is contained in:
Magne Sjaastad
2017-09-20 09:58:10 +02:00
parent 5ddb796059
commit f61122ce0e
3 changed files with 9 additions and 7 deletions

View File

@@ -330,7 +330,7 @@ protected:
caf::PdmUiTreeSelectionEditorAttribute* attr = dynamic_cast<caf::PdmUiTreeSelectionEditorAttribute*>(attribute);
if (attr)
{
attr->highLightField = m_highlightedEnum.uiCapability();
attr->fieldToReceiveCurrentFieldValue = m_highlightedEnum.uiCapability();
}
}
}

View File

@@ -409,13 +409,11 @@ void PdmUiTreeSelectionEditor::slotTextFilterChanged()
//--------------------------------------------------------------------------------------------------
void PdmUiTreeSelectionEditor::slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous)
{
if (m_attributes.highLightField)
if (m_attributes.fieldToReceiveCurrentFieldValue)
{
QVariant v = m_proxyModel->data(current, PdmUiTreeSelectionQModel::optionItemValueRole());
//m_attributes.highLightField->fieldHandle()->setvalue();
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_attributes.highLightField, v);
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_attributes.fieldToReceiveCurrentFieldValue, v);
}
}

View File

@@ -62,7 +62,11 @@ public:
bool showTextFilter;
bool showToggleAllCheckbox;
caf::PdmUiFieldHandle* highLightField;
/// fieldToReceiveCurrentFieldValue is used to communicate the value of current item in the tree view
/// This is useful when displaying a list of appEnums, and a dependent view is displaying content based on
/// the current item in the tree view
/// Make sure the type of the receiving field is of the same type as the field used in PdmUiTreeSelectionEditor
caf::PdmUiFieldHandle* fieldToReceiveCurrentFieldValue;
public:
PdmUiTreeSelectionEditorAttribute()
@@ -70,7 +74,7 @@ public:
showTextFilter = true;
showToggleAllCheckbox = true;
highLightField = nullptr;
fieldToReceiveCurrentFieldValue = nullptr;
}
};