#842 Added plot title

This commit is contained in:
Magne Sjaastad 2016-10-14 15:38:21 +02:00
parent d5213b2a43
commit 9a7138ddcd
2 changed files with 17 additions and 2 deletions

View File

@ -55,6 +55,7 @@ RimSummaryPlot::RimSummaryPlot()
m_showWindow.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_userName, "PlotDescription", QString("Summary Plot"), "Name", "", "", "");
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_curveFilters, "SummaryCurveFilters", "", "", "", "");
m_curveFilters.uiCapability()->setUiTreeHidden(true);
@ -398,7 +399,8 @@ void RimSummaryPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
uiCapability()->updateUiIconFromToggleField();
}
else if (changedField == &m_userName)
else if (changedField == &m_userName ||
changedField == &m_showPlotTitle)
{
updateViewerWidgetWindowTitle();
}
@ -586,6 +588,15 @@ void RimSummaryPlot::updateViewerWidgetWindowTitle()
if (m_qwtPlot)
{
m_qwtPlot->setWindowTitle(m_userName);
if (m_showPlotTitle)
{
m_qwtPlot->setTitle(m_userName);
}
else
{
m_qwtPlot->setTitle("");
}
}
}

View File

@ -79,7 +79,8 @@ public:
bool isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const;
void selectAxisInPropertyEditor(int axis);
void selectAxisInPropertyEditor(int axis);
protected:
// Overridden PDM methods
virtual caf::PdmFieldHandle* objectToggleField() { return &m_showWindow; }
@ -105,7 +106,10 @@ private:
private:
caf::PdmField<bool> m_showWindow;
caf::PdmField<bool> m_showPlotTitle;
caf::PdmField<QString> m_userName;
caf::PdmChildArrayField<RimSummaryCurve*> m_curves;
caf::PdmChildArrayField<RimSummaryCurveFilter*> m_curveFilters;