Skip to content

Commit

Permalink
Use AppEnumField in test application
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Mar 3, 2024
1 parent c439033 commit e505ed4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AppEnumField : public PdmValueField

QVariant toQVariant() const override
{
auto enumValue = static_cast<std::underlying_type_t<DataType>>( m_fieldValue );
auto enumValue = static_cast<std::underlying_type_t<DataType>>( m_fieldValue.value() );
return enumValue;
}

Expand Down
4 changes: 4 additions & 0 deletions Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "cafCmdSelectionHelper.h"
#endif

#include "cafAppEnumField.h"
#include "cafCmdFeatureMenuBuilder.h"
#include "cafFilePath.h"
#include "cafPdmDocument.h"
Expand Down Expand Up @@ -715,6 +716,8 @@ class SmallDemoPdmObjectA : public caf::PdmObject
"",
"",
"" );

CAF_PDM_InitFieldNoDefault( &m_testAppEnumField, "TestAppEnumValue", "AppEnum Field" );
CAF_PDM_InitFieldNoDefault( &m_ptrField, "m_ptrField", "PtrField", "", "", "" );

CAF_PDM_InitFieldNoDefault( &m_proxyEnumField, "ProxyEnumValue", "ProxyEnum", "", "", "" );
Expand All @@ -733,6 +736,7 @@ class SmallDemoPdmObjectA : public caf::PdmObject
caf::PdmField<int> m_intField;
caf::PdmField<QString> m_textField;
caf::PdmField<caf::AppEnum<TestEnumType>> m_testEnumField;
caf::AppEnumField<TestEnumType> m_testAppEnumField;
caf::PdmPtrField<SmallDemoPdmObjectA*> m_ptrField;

caf::PdmProxyValueField<caf::AppEnum<TestEnumType>> m_proxyEnumField;
Expand Down

0 comments on commit e505ed4

Please sign in to comment.