#7667 Refactor: extract number format settings for reuse.

This commit is contained in:
Kristian Bendiksen
2021-05-28 15:56:54 +02:00
committed by Magne Sjaastad
parent 5d703b2a08
commit b2025fbeef
8 changed files with 119 additions and 61 deletions

View File

@@ -35,7 +35,7 @@ RiuScalarMapperLegendFrame::RiuScalarMapperLegendFrame( QWidget* parent, const Q
: RiuAbstractLegendFrame( parent, title )
, m_scalarMapper( scalarMapper )
, m_tickNumberPrecision( 4 )
, m_numberFormat( RimRegularLegendConfig::NumberFormatType::AUTO )
, m_numberFormat( RiaNumberFormat::NumberFormatType::AUTO )
{
if ( m_scalarMapper.notNull() )
{
@@ -126,7 +126,7 @@ void RiuScalarMapperLegendFrame::layoutInfo( LayoutInfo* layout ) const
QString RiuScalarMapperLegendFrame::label( int index ) const
{
double tickValue = m_tickValues[index];
return RimRegularLegendConfig::valueToText( tickValue, m_numberFormat, m_tickNumberPrecision );
return RiaNumberFormat::valueToText( tickValue, m_numberFormat, m_tickNumberPrecision );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -17,6 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaNumberFormat.h"
#include "RimRegularLegendConfig.h"
#include "RiuAbstractLegendFrame.h"
@@ -37,7 +39,7 @@ class RiuScalarMapperLegendFrame : public RiuAbstractLegendFrame
Q_OBJECT
public:
using NumberFormat = RimRegularLegendConfig::NumberFormatType;
using NumberFormat = RiaNumberFormat::NumberFormatType;
public:
RiuScalarMapperLegendFrame( QWidget* parent, const QString& title, cvf::ScalarMapper* scalarMapper );