mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#5220 Use caf::PdmUiDoubleEditor for depth axis range in Well Log Plots
* And set two decimals and fixed notation
This commit is contained in:
parent
7391c7acfe
commit
8b1aa319a6
@ -39,6 +39,7 @@
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiDoubleValueEditor.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
@ -89,6 +90,9 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
|
||||
CAF_PDM_InitField( &m_minVisibleDepth, "MinimumDepth", 0.0, "Min", "", "", "" );
|
||||
CAF_PDM_InitField( &m_maxVisibleDepth, "MaximumDepth", 1000.0, "Max", "", "", "" );
|
||||
m_minVisibleDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
|
||||
m_maxVisibleDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthAxisGridVisibility, "ShowDepthGridLines", "Show Grid Lines", "", "", "" );
|
||||
CAF_PDM_InitField( &m_isAutoScaleDepthEnabled, "AutoScaleDepthEnabled", true, "Auto Scale", "", "", "" );
|
||||
m_isAutoScaleDepthEnabled.uiCapability()->setUiHidden( true );
|
||||
@ -694,6 +698,15 @@ void RimWellLogPlot::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
comboAttr->iconSize = QSize( 24, 14 );
|
||||
}
|
||||
}
|
||||
else if ( field == &m_minVisibleDepth || field == &m_maxVisibleDepth )
|
||||
{
|
||||
auto doubleAttr = dynamic_cast<caf::PdmUiDoubleValueEditorAttribute*>( attribute );
|
||||
if ( doubleAttr )
|
||||
{
|
||||
doubleAttr->m_decimals = 2;
|
||||
doubleAttr->m_numberFormat = caf::PdmUiDoubleValueEditorAttribute::NumberFormat::FIXED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user