mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
of windows. This might introduce problems.
This commit is contained in:
@@ -85,6 +85,8 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
|
||||
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Auto Zoom", "", "", "");
|
||||
m_isAutoZoom.uiCapability()->setUiHidden(true);
|
||||
|
||||
setAsPlotMDI();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -92,29 +94,14 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot::~RimSummaryPlot()
|
||||
{
|
||||
if (RiaApplication::instance()->mainPlotWindow())
|
||||
{
|
||||
RiaApplication::instance()->mainPlotWindow()->removeViewer(m_qwtPlot);
|
||||
}
|
||||
removeWidgetFromMDI();
|
||||
|
||||
deletePlotWidget();
|
||||
deleteViewWidget();
|
||||
|
||||
m_curves.deleteAllChildObjects();
|
||||
m_curveFilters.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deletePlotWidget()
|
||||
{
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
m_qwtPlot->deleteLater();
|
||||
m_qwtPlot = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -367,22 +354,6 @@ void RimSummaryPlot::updateTimeAxis()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::handleViewerDeletion()
|
||||
{
|
||||
m_showWindow = false;
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
detachAllCurves();
|
||||
}
|
||||
|
||||
uiCapability()->updateUiIconFromToggleField();
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -512,7 +483,7 @@ void RimSummaryPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
else
|
||||
{
|
||||
updateViewerWidget();
|
||||
updateViewerWidgetBasic();
|
||||
}
|
||||
|
||||
uiCapability()->updateUiIconFromToggleField();
|
||||
@@ -524,16 +495,6 @@ void RimSummaryPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::setupBeforeSave()
|
||||
{
|
||||
if (m_qwtPlot && RiaApplication::instance()->mainPlotWindow())
|
||||
{
|
||||
this->setMdiWindowGeometry(RiaApplication::instance()->mainPlotWindow()->windowGeometryForViewer(m_qwtPlot));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -578,7 +539,7 @@ void RimSummaryPlot::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::loadDataAndUpdate()
|
||||
{
|
||||
updateViewerWidget();
|
||||
updateViewerWidgetBasic();
|
||||
|
||||
for (RimSummaryCurveFilter* curveFilter: m_curveFilters)
|
||||
{
|
||||
@@ -669,44 +630,37 @@ QString RimSummaryPlot::description() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateViewerWidget()
|
||||
QWidget* RimSummaryPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
{
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
if (!mainPlotWindow) return;
|
||||
|
||||
if (m_showWindow())
|
||||
if (!m_qwtPlot)
|
||||
{
|
||||
if (!m_qwtPlot)
|
||||
m_qwtPlot = new RiuSummaryQwtPlot(this, mainWindowParent);
|
||||
|
||||
for(RimSummaryCurveFilter* curveFilter: m_curveFilters)
|
||||
{
|
||||
m_qwtPlot = new RiuSummaryQwtPlot(this, mainPlotWindow);
|
||||
|
||||
for(RimSummaryCurveFilter* curveFilter: m_curveFilters)
|
||||
{
|
||||
curveFilter->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for(RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
mainPlotWindow->addViewer(m_qwtPlot, this->mdiWindowGeometry());
|
||||
mainPlotWindow->setActiveViewer(m_qwtPlot);
|
||||
curveFilter->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
updateViewerWidgetWindowTitle();
|
||||
for(RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
return m_qwtPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteViewWidget()
|
||||
{
|
||||
detachAllCurves();
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
this->setMdiWindowGeometry(mainPlotWindow->windowGeometryForViewer(m_qwtPlot));
|
||||
|
||||
mainPlotWindow->removeViewer(m_qwtPlot);
|
||||
detachAllCurves();
|
||||
|
||||
deletePlotWidget();
|
||||
}
|
||||
m_qwtPlot->deleteLater();
|
||||
m_qwtPlot = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user