Remove QT_CHARTS dependency.

This commit is contained in:
Kristian Bendiksen committed 2025-07-30 13:39:02 +02:00
1 parent fa3f43456e
commit ade8e1d7e6
25 files changed
+3 -3154

No files matched your search

@@ -68,10 +68,6 @@
#include "RiuQwtPlotWidget.h"
#include "RiuSummaryQwtPlot.h"
#ifdef USE_QTCHARTS
#include "RiuSummaryQtChartsPlot.h"
#endif
#include "cvfColor3.h"
#include "cafPdmFieldScriptingCapability.h"
@@ -130,11 +126,7 @@ RimSummaryPlot::RimSummaryPlot()
CAF_PDM_InitScriptableField( &m_useAutoPlotTitle, "IsUsingAutoName", true, "Auto Title" );
CAF_PDM_InitScriptableField( &m_description, "PlotDescription", QString( "Summary Plot" ), "Name" );
CAF_PDM_InitScriptableField( &m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves" );
#ifdef USE_QTCHARTS
bool useQtChart = RiaPreferences::current()->useQtChartsAsDefaultPlotType();
CAF_PDM_InitScriptableField( &m_useQtChartsPlot, "useQtChartsPlot", useQtChart, "Use Qt Charts" );
m_useQtChartsPlot.uiCapability()->setUiHidden( true );
#endif
CAF_PDM_InitFieldNoDefault( &m_summaryCurveCollection, "SummaryCurveCollection", "" );
m_summaryCurveCollection = new RimSummaryCurveCollection;
m_summaryCurveCollection->curvesChanged.connect( this, &RimSummaryPlot::onCurveCollectionChanged );
@@ -1602,29 +1594,6 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
if ( changedField == &m_showPlotLegends ) updateLegend();
#ifdef USE_QTCHARTS
if ( changedField == &m_useQtChartsPlot )
{
// Hide window
setShowWindow( false );
// Detach and destroy plot curves
for ( auto c : summaryCurves() )
{
c->detach( true );
}
for ( auto& curveSet : ensembleCurveSetCollection()->curveSets() )
{
curveSet->deletePlotCurves();
}
// Destroy viewer
removeMdiWindowFromMdiArea();
deletePlotCurvesAndPlotWidget();
}
#endif
if ( changedField == &m_normalizeCurveYValues )
{
loadDataAndUpdate();
@@ -2604,9 +2573,6 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
}
caf::PdmUiGroup* mainOptions = uiOrdering.addNewGroup( "General Plot Options" );
#ifdef USE_QTCHARTS
mainOptions->add( &m_useQtChartsPlot );
#endif
if ( isMdiWindow() )
{
mainOptions->add( &m_showPlotTitle );
@@ -2640,34 +2606,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent
{
if ( !plotWidget() )
{
#ifdef USE_QTCHARTS
bool useQtCharts = m_useQtChartsPlot;
auto regTestRunner = RiaRegressionTestRunner::instance();
if ( regTestRunner->isRunningRegressionTests() )
{
if ( regTestRunner->overridePlotEngine() == RiaRegressionTest::PlotEngine::USE_QWT )
useQtCharts = false;
else if ( regTestRunner->overridePlotEngine() == RiaRegressionTest::PlotEngine::USER_QTCHARTS )
useQtCharts = true;
}
// Disable all use of QtCharts for now. If a plot was created using QtCharts during the period this flag was
// active, the use of QtCharts was stored in the project file or template file. Set flag to false to force use
// of Qwt
useQtCharts = false;
if ( useQtCharts )
{
m_summaryPlot = std::make_unique<RiuSummaryQtChartsPlot>( this, mainWindowParent );
}
else
{
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
}
#else
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
#endif
QObject::connect( plotWidget(), SIGNAL( curveOrderNeedsUpdate() ), this, SLOT( onUpdateCurveOrder() ) );