mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
parent
db869ccbd5
commit
72a5c6cfef
@ -153,6 +153,9 @@ RiaApplication::RiaApplication()
|
||||
RiaApplication::~RiaApplication()
|
||||
{
|
||||
delete m_preferences;
|
||||
delete m_project;
|
||||
|
||||
RiaFontCache::clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -129,3 +129,11 @@ RiaFontCache::FontSize RiaFontCache::fontSizeEnumFromPointSize( int pointSize )
|
||||
}
|
||||
return closestEnumValue;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaFontCache::clear()
|
||||
{
|
||||
ms_fonts.clear();
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ public:
|
||||
static int pointSizeFromFontSizeEnum( FontSize fontSize );
|
||||
static FontSize fontSizeEnumFromPointSize( int pointSize );
|
||||
|
||||
static void clear();
|
||||
|
||||
private:
|
||||
static std::map<FontSize, cvf::ref<caf::FixedAtlasFont>> ms_fonts;
|
||||
};
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include <memory>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicEditSummaryPlotFeature, "RicEditSummaryPlotFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -60,9 +62,14 @@ void RicEditSummaryPlotFeature::closeDialogAndResetTargetPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorDialog* RicEditSummaryPlotFeature::curveCreatorDialog()
|
||||
{
|
||||
static RicSummaryCurveCreatorDialog* singletonDialog = new RicSummaryCurveCreatorDialog( nullptr );
|
||||
static std::unique_ptr<RicSummaryCurveCreatorDialog> singletonDialog;
|
||||
|
||||
return singletonDialog;
|
||||
if ( !singletonDialog )
|
||||
{
|
||||
singletonDialog.reset( new RicSummaryCurveCreatorDialog( nullptr ) );
|
||||
}
|
||||
|
||||
return singletonDialog.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -36,7 +36,7 @@
|
||||
RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog( QWidget* parent )
|
||||
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
||||
{
|
||||
m_curveCreatorSplitterUi = new RicSummaryCurveCreatorSplitterUi( this );
|
||||
m_curveCreatorSplitterUi.reset( new RicSummaryCurveCreatorSplitterUi( this ) );
|
||||
|
||||
QWidget* propertyWidget = m_curveCreatorSplitterUi->getOrCreateWidget( this );
|
||||
|
||||
@ -46,7 +46,7 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog( QWidget* parent )
|
||||
|
||||
setWindowTitle( "Plot Editor" );
|
||||
resize( 1200, 800 );
|
||||
connect( m_curveCreatorSplitterUi, SIGNAL( signalCloseButtonPressed() ), this, SLOT( accept() ) );
|
||||
connect( m_curveCreatorSplitterUi.get(), SIGNAL( signalCloseButtonPressed() ), this, SLOT( accept() ) );
|
||||
|
||||
connect( this, SIGNAL( finished( int ) ), this, SLOT( slotDialogFinished() ) );
|
||||
}
|
||||
@ -54,7 +54,10 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog( QWidget* parent )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorDialog::~RicSummaryCurveCreatorDialog() {}
|
||||
RicSummaryCurveCreatorDialog::~RicSummaryCurveCreatorDialog()
|
||||
{
|
||||
m_curveCreatorSplitterUi->setPdmObject( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmObject;
|
||||
@ -47,5 +49,5 @@ private slots:
|
||||
void slotDialogFinished();
|
||||
|
||||
private:
|
||||
RicSummaryCurveCreatorSplitterUi* m_curveCreatorSplitterUi;
|
||||
std::unique_ptr<RicSummaryCurveCreatorSplitterUi> m_curveCreatorSplitterUi;
|
||||
};
|
||||
|
@ -65,6 +65,10 @@ void RifEclipseSummaryTools::findSummaryFiles( const QString& inputFile, QString
|
||||
std::string extention;
|
||||
if ( myExtention ) extention = myExtention;
|
||||
|
||||
free( myExtention );
|
||||
free( myBase );
|
||||
free( myPath );
|
||||
|
||||
if ( path.isEmpty() || base.isEmpty() ) return;
|
||||
|
||||
char* myHeaderFile = nullptr;
|
||||
|
@ -205,13 +205,7 @@ RimProject::RimProject( void )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimProject::~RimProject( void )
|
||||
{
|
||||
close();
|
||||
|
||||
oilFields.deleteAllChildObjects();
|
||||
if ( scriptCollection() ) delete scriptCollection();
|
||||
}
|
||||
RimProject::~RimProject( void ) {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -52,7 +52,7 @@ RiuQwtPlotCurve::RiuQwtPlotCurve( const QString& title )
|
||||
|
||||
m_symbolSkipPixelDistance = 10.0f;
|
||||
|
||||
m_errorBars = new QwtPlotIntervalCurve();
|
||||
m_errorBars = std::unique_ptr<QwtPlotIntervalCurve>( new QwtPlotIntervalCurve() );
|
||||
m_errorBars->setStyle( QwtPlotIntervalCurve::CurveStyle::NoCurve );
|
||||
m_errorBars->setSymbol( new QwtIntervalSymbol( QwtIntervalSymbol::Bar ) );
|
||||
m_errorBars->setItemAttribute( QwtPlotItem::Legend, false );
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "qwt_plot_intervalcurve.h"
|
||||
#include "qwt_symbol.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class RiuErrorBarsQwtPlotCurve;
|
||||
|
||||
//==================================================================================================
|
||||
@ -150,10 +152,10 @@ private:
|
||||
std::vector<std::pair<size_t, size_t>> m_polyLineStartStopIndices;
|
||||
float m_symbolSkipPixelDistance;
|
||||
|
||||
bool m_showErrorBars;
|
||||
QwtPlotIntervalCurve* m_errorBars;
|
||||
QwtPlot* m_attachedToPlot;
|
||||
bool m_blackAndWhiteLegendIcon;
|
||||
bool m_showErrorBars;
|
||||
std::unique_ptr<QwtPlotIntervalCurve> m_errorBars;
|
||||
QwtPlot* m_attachedToPlot;
|
||||
bool m_blackAndWhiteLegendIcon;
|
||||
|
||||
std::vector<QString> m_perPointLabels;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user