Skip to content

Commit

Permalink
[Fwk] Fix for missing use of command framework for tree view model
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Dec 22, 2015
1 parent 390b04b commit 5296add
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class DemoPdmObject: public caf::PdmObject
CAF_PDM_InitField(&m_doubleField, "BigNumber", 0.0, "Big Number", "", "Enter a big number here", "This is a place you can enter a big real value if you want");
CAF_PDM_InitField(&m_intField, "IntNumber", 0, "Small Number", "", "Enter some small number here", "This is a place you can enter a small integer value if you want" );
CAF_PDM_InitField(&m_boolField, "BooleanValue", false, "Boolean:" , "", "Boolean:Enter some small number here", "Boolean:This is a place you can enter a small integer value if you want");
CAF_PDM_InitField(&m_textField, "TextField", QString("Demo Object Description Field"), "", "", "", "");
CAF_PDM_InitField(&m_textField, "TextField", QString("Demo Object Description Field"), "Description Field", "", "", "");
CAF_PDM_InitField(&m_filePath, "FilePath", QString(""), "Filename", "", "", "");
CAF_PDM_InitField(&m_longText, "LongText", QString("Test text"), "Long Text", "", "", "");

Expand Down
5 changes: 3 additions & 2 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmUiCommandSystemProxy.h"
#include "cafPdmUiDragDropInterface.h"
#include "cafPdmUiTreeItemEditor.h"
#include "cafPdmUiTreeOrdering.h"
Expand Down Expand Up @@ -684,7 +685,7 @@ bool PdmUiTreeViewModel::setData(const QModelIndex &index, const QVariant &value
PdmUiFieldHandle* userDescriptionUiField = uiObject->userDescriptionField()->uiCapability();
if (userDescriptionUiField)
{
userDescriptionUiField->setValueFromUi(value);
PdmUiCommandSystemProxy::instance()->setUiValueToField(userDescriptionUiField, value);
}

return true;
Expand All @@ -698,7 +699,7 @@ bool PdmUiTreeViewModel::setData(const QModelIndex &index, const QVariant &value
PdmUiFieldHandle* toggleUiField = uiObject->objectToggleField()->uiCapability();
if (toggleUiField)
{
toggleUiField->setValueFromUi(value);
PdmUiCommandSystemProxy::instance()->setUiValueToField(toggleUiField, toggleOn);
}

return true;
Expand Down

0 comments on commit 5296add

Please sign in to comment.