mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
caf: Update cafTestApplication for attribute map and deploy Qt runtime
This commit is contained in:
1 parent
bb4492c308
commit
e2bd5767e9
3 files changed
+14
-37
No files matched your search
@@ -80,6 +80,8 @@ qt_add_executable(
|
||||
# when we can use target_link_libraries with OBJECT libraries
|
||||
)
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES AUTORCC ON)
|
||||
|
||||
set(TAP_LINK_LIBRARIES cafUserInterface)
|
||||
|
||||
if(USE_COMMAND_FRAMEWORK)
|
||||
@@ -101,6 +103,15 @@ target_link_libraries(
|
||||
${EXTERNAL_LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
# Make the executable runnable from its own folder (platform plugins etc.)
|
||||
if(WIN32 AND TARGET Qt6::windeployqt)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMAND Qt6::windeployqt --no-translations $<TARGET_FILE:${PROJECT_NAME}>
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(qtlib ${QT_LIBRARIES})
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME}
|
||||
|
||||
@@ -43,6 +43,7 @@ SmallDemoPdmObjectA::SmallDemoPdmObjectA()
|
||||
" Toggle Field whatsthis" );
|
||||
|
||||
CAF_PDM_InitField( &m_pushButtonField, "Push", false, "Button Field", "", "", " " );
|
||||
m_pushButtonField.uiCapability()->setAttribute( caf::PdmUiTableViewEditor::CellKeys::PUSH_BUTTON_TEXT, "Edit" );
|
||||
CAF_PDM_InitField( &m_doubleField,
|
||||
"BigNumber",
|
||||
0.0,
|
||||
@@ -70,6 +71,8 @@ SmallDemoPdmObjectA::SmallDemoPdmObjectA()
|
||||
CAF_PDM_InitFieldNoDefault( &m_multipleAppEnum, "MultipleAppEnumValue", "MultipleAppEnumValue", "", "", "" );
|
||||
m_multipleAppEnum.capability<caf::PdmUiFieldHandle>()->setUiEditorTypeName(
|
||||
caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
m_multipleAppEnum.uiCapability()->setAttribute<caf::PdmFieldHandle*>( caf::PdmUiTreeSelectionEditor::Keys::CURRENT_INDEX_FIELD_HANDLE,
|
||||
&m_highlightedEnum );
|
||||
CAF_PDM_InitFieldNoDefault( &m_highlightedEnum, "HighlightedEnum", "HighlightedEnum", "", "", "" );
|
||||
m_highlightedEnum.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
@@ -233,33 +236,3 @@ QList<caf::PdmOptionItemInfo> SmallDemoPdmObjectA::calculateValueOptions( const
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void SmallDemoPdmObjectA::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( field == &m_multipleAppEnum )
|
||||
{
|
||||
caf::PdmUiTreeSelectionEditorAttribute* attr = dynamic_cast<caf::PdmUiTreeSelectionEditorAttribute*>( attribute );
|
||||
if ( attr )
|
||||
{
|
||||
attr->currentIndexFieldHandle = &m_highlightedEnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void SmallDemoPdmObjectA::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
caf::PdmUiTableViewPushButtonEditorAttribute* attr =
|
||||
dynamic_cast<caf::PdmUiTableViewPushButtonEditorAttribute*>( attribute );
|
||||
if ( attr )
|
||||
{
|
||||
attr->registerPushButtonTextForFieldKeyword( m_pushButtonField.keyword(), "Edit" );
|
||||
}
|
||||
}
|
||||
@@ -41,13 +41,6 @@ public:
|
||||
void setAutoValueForDouble( double value );
|
||||
void setAutoValueForInt( double value );
|
||||
|
||||
protected:
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<double> m_doubleField;
|
||||
caf::PdmField<int> m_intField;
|
||||
|
||||
Reference in new issue
Block a user