From a1bada1f6434f48bc43cdc805f402e4f93f0f5f4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 3 Mar 2024 14:08:25 +0100 Subject: [PATCH] Use AppEnumField in test application --- Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnumField.h | 2 +- Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnumField.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnumField.h index 523493b4ac..412bded6aa 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnumField.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnumField.h @@ -24,7 +24,7 @@ public: QVariant toQVariant() const override { - auto enumValue = static_cast>( m_fieldValue ); + auto enumValue = static_cast>( m_fieldValue.value() ); return enumValue; } diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp index 3e0bdee720..dbd0aa404a 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp +++ b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp @@ -18,6 +18,7 @@ #include "cafCmdSelectionHelper.h" #endif +#include "cafAppEnumField.h" #include "cafCmdFeatureMenuBuilder.h" #include "cafFilePath.h" #include "cafPdmDocument.h" @@ -714,6 +715,8 @@ public: "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_testAppEnumField, "TestAppEnumValue", "AppEnum Field" ); CAF_PDM_InitFieldNoDefault( &m_ptrField, "m_ptrField", "PtrField", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_proxyEnumField, "ProxyEnumValue", "ProxyEnum", "", "", "" ); @@ -732,6 +735,7 @@ public: caf::PdmField m_intField; caf::PdmField m_textField; caf::PdmField> m_testEnumField; + caf::AppEnumField m_testAppEnumField; caf::PdmPtrField m_ptrField; caf::PdmProxyValueField> m_proxyEnumField;