mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#4341 Make docked plots follow font size preferences (but subtract 1 in point size)
* The docked plots have much less space available than most plots
This commit is contained in:
parent
93f76d9739
commit
edf46496b7
@ -2158,6 +2158,11 @@ void RiaApplication::applyPreferences(const RiaPreferences* oldPreferences)
|
||||
wellPathCollection->wellPathLabelColor = oldPreferences->defaultWellLabelColor();
|
||||
uiEditorsToUpdate.insert(wellPathCollection);
|
||||
}
|
||||
|
||||
if (oldPreferences->defaultPlotFontSize() != m_preferences->defaultPlotFontSize())
|
||||
{
|
||||
m_mainWindow->applyFontSizesToDockedPlots();
|
||||
}
|
||||
}
|
||||
|
||||
for (caf::PdmUiItem* uiItem : uiEditorsToUpdate)
|
||||
|
@ -79,7 +79,7 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitFieldNoDefault(&defaultAnnotationFontSize, "defaultAnnotationFontSize", "Annotation Font Size", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&defaultWellLabelFontSize, "wellLabelFontSize", "Well Label Font Size", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&defaultPlotFontSize, "defaultPlotFontSize", "Plot Font Size", "", "", "");
|
||||
defaultPlotFontSize = RiaFontCache::FONT_SIZE_10;
|
||||
defaultPlotFontSize = RiaFontCache::FONT_SIZE_8;
|
||||
|
||||
CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS Curve Without TVD Warning", "", "", "");
|
||||
showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
@ -38,6 +38,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h
|
||||
@ -122,6 +123,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.cpp
|
||||
@ -193,6 +195,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.h
|
||||
|
78
ApplicationCode/UserInterface/RiuDockedQwtPlot.cpp
Normal file
78
ApplicationCode/UserInterface/RiuDockedQwtPlot.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "qwt_abstract_legend.h"
|
||||
#include "qwt_text.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <set>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuDockedQwtPlot::RiuDockedQwtPlot(QWidget* parent /*= nullptr*/)
|
||||
: QwtPlot(parent)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockedQwtPlot::applyFontSizes(bool replot /*= false*/)
|
||||
{
|
||||
std::set<QwtPlot::Axis> allAxes = {QwtPlot::xBottom, QwtPlot::yLeft, QwtPlot::xTop, QwtPlot::yRight};
|
||||
|
||||
RiaFontCache::FontSize fontSizeEnum = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
int fontPointSize = RiaFontCache::pointSizeFromFontSizeEnum(fontSizeEnum) - 1;
|
||||
|
||||
for (QwtPlot::Axis axis : allAxes)
|
||||
{
|
||||
QwtText text = this->axisTitle(axis);
|
||||
QFont font = text.font();
|
||||
font.setPointSize(fontPointSize);
|
||||
text.setFont(font);
|
||||
this->setAxisTitle(axis, text);
|
||||
|
||||
QFont valuesFont = this->axisFont(axis);
|
||||
valuesFont.setPointSize(fontPointSize);
|
||||
this->setAxisFont(axis, valuesFont);
|
||||
}
|
||||
|
||||
if (legend())
|
||||
{
|
||||
auto font = legend()->font();
|
||||
font.setPointSize(fontPointSize);
|
||||
legend()->setFont(font);
|
||||
}
|
||||
|
||||
QwtText titleText = this->title();
|
||||
QFont font = titleText.font();
|
||||
|
||||
font.setPointSize(fontPointSize + 3);
|
||||
titleText.setFont(font);
|
||||
this->setTitle(titleText);
|
||||
|
||||
if (replot)
|
||||
{
|
||||
this->replot();
|
||||
}
|
||||
}
|
30
ApplicationCode/UserInterface/RiuDockedQwtPlot.h
Normal file
30
ApplicationCode/UserInterface/RiuDockedQwtPlot.h
Normal file
@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
class RiuDockedQwtPlot : public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RiuDockedQwtPlot(QWidget* parent = nullptr);
|
||||
|
||||
void applyFontSizes(bool replot);
|
||||
};
|
||||
|
@ -1817,6 +1817,17 @@ void RiuMainWindow::setDefaultToolbarVisibility()
|
||||
m_holoLensToolBar->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::applyFontSizesToDockedPlots()
|
||||
{
|
||||
m_resultQwtPlot->applyFontSizes(true);
|
||||
m_mohrsCirclePlot->applyFontSizes(true);
|
||||
m_relPermPlotPanel->applyFontSizes(true);
|
||||
m_pvtPlotPanel->applyFontSizes(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -128,6 +128,7 @@ public:
|
||||
|
||||
void showProcessMonitorDockPanel();
|
||||
void setDefaultToolbarVisibility();
|
||||
void applyFontSizesToDockedPlots();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
@ -62,7 +62,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMohrsCirclePlot::RiuMohrsCirclePlot(QWidget* parent)
|
||||
: QwtPlot(parent)
|
||||
: RiuDockedQwtPlot(parent)
|
||||
, m_sourceGeoMechViewOfLastPlot(nullptr)
|
||||
, m_scheduleUpdateAxisScaleTimer(nullptr)
|
||||
{
|
||||
@ -76,6 +76,8 @@ RiuMohrsCirclePlot::RiuMohrsCirclePlot(QWidget* parent)
|
||||
setAxisTitle(QwtPlot::xBottom, "Effective Normal Stress");
|
||||
setAxisTitle(QwtPlot::yLeft, "Shear Stress");
|
||||
|
||||
applyFontSizes(false);
|
||||
|
||||
// The legend will be deleted in the destructor of the plot or when
|
||||
// another legend is inserted.
|
||||
QwtLegend* legend = new QwtLegend(this);
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_item.h"
|
||||
@ -39,7 +41,7 @@ class RiuSelectionItem;
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuMohrsCirclePlot : public QwtPlot
|
||||
class RiuMohrsCirclePlot : public RiuDockedQwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuPvtPlotPanel.h"
|
||||
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
#include "RiuPvtPlotUpdater.h"
|
||||
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
@ -49,10 +51,10 @@
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class PvtQwtPlot : public QwtPlot
|
||||
class PvtQwtPlot : public RiuDockedQwtPlot
|
||||
{
|
||||
public:
|
||||
PvtQwtPlot(QWidget* parent) : QwtPlot(parent) {}
|
||||
PvtQwtPlot(QWidget* parent) : RiuDockedQwtPlot(parent) {}
|
||||
QSize sizeHint() const override { return QSize(100, 100); }
|
||||
QSize minimumSizeHint() const override { return QSize(0, 0); }
|
||||
};
|
||||
@ -103,6 +105,7 @@ RiuPvtPlotWidget::RiuPvtPlotWidget(RiuPvtPlotPanel* parent)
|
||||
{
|
||||
m_qwtPlot = new PvtQwtPlot(this);
|
||||
setPlotDefaults(m_qwtPlot);
|
||||
applyFontSizes(false);
|
||||
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
layout->addWidget(m_qwtPlot);
|
||||
@ -147,7 +150,7 @@ void RiuPvtPlotWidget::setPlotDefaults(QwtPlot* plot)
|
||||
// Axis number font
|
||||
{
|
||||
QFont axisFont = plot->axisFont(QwtPlot::xBottom);
|
||||
axisFont.setPointSize(10);
|
||||
axisFont.setPointSize(8);
|
||||
plot->setAxisFont(QwtPlot::xBottom, axisFont);
|
||||
plot->setAxisFont(QwtPlot::yLeft, axisFont);
|
||||
}
|
||||
@ -156,7 +159,7 @@ void RiuPvtPlotWidget::setPlotDefaults(QwtPlot* plot)
|
||||
{
|
||||
QwtText axisTitle = plot->axisTitle(QwtPlot::xBottom);
|
||||
QFont axisTitleFont = axisTitle.font();
|
||||
axisTitleFont.setPointSize(10);
|
||||
axisTitleFont.setPointSize(8);
|
||||
axisTitleFont.setBold(false);
|
||||
axisTitle.setFont(axisTitleFont);
|
||||
axisTitle.setRenderFlags(Qt::AlignRight);
|
||||
@ -168,7 +171,7 @@ void RiuPvtPlotWidget::setPlotDefaults(QwtPlot* plot)
|
||||
{
|
||||
QwtText plotTitle = plot->title();
|
||||
QFont titleFont = plotTitle.font();
|
||||
titleFont.setPointSize(14);
|
||||
titleFont.setPointSize(12);
|
||||
plotTitle.setFont(titleFont);
|
||||
plot->setTitle(plotTitle);
|
||||
}
|
||||
@ -307,6 +310,14 @@ void RiuPvtPlotWidget::plotCurves(RiaEclipseUnitTools::UnitSystem unitSystem, co
|
||||
m_qwtPlot->replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotWidget::applyFontSizes(bool replot)
|
||||
{
|
||||
m_qwtPlot->applyFontSizes(replot);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -506,7 +517,7 @@ RiuPvtPlotPanel::RiuPvtPlotPanel(QDockWidget* parent)
|
||||
m_titleLabel = new QLabel("", this);
|
||||
m_titleLabel->setAlignment(Qt::AlignHCenter);
|
||||
QFont font = m_titleLabel->font();
|
||||
font.setPointSize(14);
|
||||
font.setPointSize(10);
|
||||
font.setBold(true);
|
||||
m_titleLabel->setFont(font);
|
||||
|
||||
@ -593,6 +604,17 @@ RiuPvtPlotUpdater* RiuPvtPlotPanel::plotUpdater()
|
||||
return m_plotUpdater.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotPanel::applyFontSizes(bool replot)
|
||||
{
|
||||
if (m_fvfPlot)
|
||||
m_fvfPlot->applyFontSizes(replot);
|
||||
if (m_viscosityPlot)
|
||||
m_viscosityPlot->applyFontSizes(replot);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
class RiuDockedQwtPlot;
|
||||
class RiuPvtPlotUpdater;
|
||||
class RiuPvtQwtPicker;
|
||||
class RiuPvtPlotPanel;
|
||||
@ -63,6 +64,7 @@ public:
|
||||
RiuPvtPlotWidget(RiuPvtPlotPanel* parent);
|
||||
|
||||
void plotCurves(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString pointMarkerLabel, QString plotTitle, QString yAxisTitle);
|
||||
void applyFontSizes(bool replot);
|
||||
|
||||
private:
|
||||
static void setPlotDefaults(QwtPlot* plot);
|
||||
@ -76,7 +78,7 @@ private:
|
||||
void slotPickerPointChanged(const QPoint& pt);
|
||||
|
||||
private:
|
||||
QPointer<QwtPlot> m_qwtPlot;
|
||||
QPointer<RiuDockedQwtPlot> m_qwtPlot;
|
||||
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_pvtCurveArr; // Array of source Pvt curves currently being plotted
|
||||
std::vector<const QwtPlotCurve*> m_qwtCurveArr; // Array of corresponding qwt curves used for mapping to Pvt curve when doing tracking
|
||||
@ -124,6 +126,7 @@ public:
|
||||
void setPlotData(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, CellValues cellValues, QString cellReferenceText);
|
||||
void clearPlot();
|
||||
RiuPvtPlotUpdater* plotUpdater();
|
||||
void applyFontSizes(bool replot);
|
||||
|
||||
private:
|
||||
void plotUiSelectedCurves();
|
||||
|
@ -16,6 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
#include "RiuRelativePermeabilityPlotPanel.h"
|
||||
#include "RiuRelativePermeabilityPlotUpdater.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
@ -56,10 +57,10 @@
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RelPermQwtPlot : public QwtPlot
|
||||
class RelPermQwtPlot : public RiuDockedQwtPlot
|
||||
{
|
||||
public:
|
||||
RelPermQwtPlot(QWidget* parent) : QwtPlot(parent) {}
|
||||
RelPermQwtPlot(QWidget* parent) : RiuDockedQwtPlot(parent) {}
|
||||
QSize sizeHint() const override { return QSize(100, 100); }
|
||||
QSize minimumSizeHint() const override { return QSize(0, 0); }
|
||||
};
|
||||
@ -88,6 +89,7 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel(QDockWidget*
|
||||
{
|
||||
m_qwtPlot = new RelPermQwtPlot(this);
|
||||
setPlotDefaults(m_qwtPlot);
|
||||
applyFontSizes(false);
|
||||
|
||||
m_selectedCurvesButtonGroup = new QButtonGroup(this);
|
||||
m_selectedCurvesButtonGroup->setExclusive(false);
|
||||
@ -159,7 +161,7 @@ void RiuRelativePermeabilityPlotPanel::setPlotDefaults(QwtPlot* plot)
|
||||
{
|
||||
QwtText plotTitle = plot->title();
|
||||
QFont titleFont = plotTitle.font();
|
||||
titleFont.setPointSize(14);
|
||||
titleFont.setPointSize(10);
|
||||
plotTitle.setFont(titleFont);
|
||||
plot->setTitle(plotTitle);
|
||||
}
|
||||
@ -228,6 +230,14 @@ RiuRelativePermeabilityPlotUpdater* RiuRelativePermeabilityPlotPanel::plotUpdate
|
||||
return m_plotUpdater.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRelativePermeabilityPlotPanel::applyFontSizes(bool replot /*= true*/)
|
||||
{
|
||||
m_qwtPlot->applyFontSizes(replot);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -465,7 +475,6 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(RiaEclipseUnitTools::Unit
|
||||
plot->setAxisTitle(QwtPlot::xBottom, determineXAxisTitleFromCurveCollection(curveArr));
|
||||
plot->setAxisTitle(QwtPlot::yLeft, "Kr");
|
||||
plot->setAxisTitle(QwtPlot::yRight, QString("Pc [%1]").arg(RiaEclipseUnitTools::unitStringPressure(unitSystem)));
|
||||
|
||||
plot->replot();
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,12 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class RiuDockedQwtPlot;
|
||||
class RiuRelativePermeabilityPlotUpdater;
|
||||
class QDockWidget;
|
||||
class QButtonGroup;
|
||||
@ -54,6 +56,7 @@ public:
|
||||
QString cellReferenceText);
|
||||
void clearPlot();
|
||||
RiuRelativePermeabilityPlotUpdater* plotUpdater();
|
||||
void applyFontSizes(bool replot);
|
||||
|
||||
private:
|
||||
enum WhichYAxis
|
||||
@ -124,7 +127,7 @@ private:
|
||||
double m_sgas;
|
||||
QString m_caseName;
|
||||
QString m_cellReferenceText;
|
||||
QwtPlot* m_qwtPlot;
|
||||
QPointer<RiuDockedQwtPlot> m_qwtPlot;
|
||||
std::vector<QwtPlotMarker*> m_myPlotMarkers;
|
||||
|
||||
QButtonGroup* m_selectedCurvesButtonGroup;
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
#include "RiuResultQwtPlot.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaCurveDataTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RimContextCommandBuilder.h"
|
||||
@ -50,7 +52,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuResultQwtPlot::RiuResultQwtPlot(QWidget* parent)
|
||||
: QwtPlot(parent)
|
||||
: RiuDockedQwtPlot(parent)
|
||||
{
|
||||
setDefaults();
|
||||
}
|
||||
@ -84,6 +86,7 @@ void RiuResultQwtPlot::addCurve(const RimCase* rimCase, const QString& curveName
|
||||
m_plotCurves.push_back(plotCurve);
|
||||
|
||||
this->setAxisScale( QwtPlot::xTop, QwtDate::toDouble(dateTimes.front()), QwtDate::toDouble(dateTimes.back()));
|
||||
this->applyFontSizes(false);
|
||||
|
||||
this->replot();
|
||||
|
||||
@ -185,6 +188,8 @@ void RiuResultQwtPlot::setDefaults()
|
||||
setAxisMaxMinor(QwtPlot::xBottom, 2);
|
||||
setAxisMaxMinor(QwtPlot::yLeft, 3);
|
||||
|
||||
applyFontSizes(false);
|
||||
|
||||
// The legend will be deleted in the destructor of the plot or when
|
||||
// another legend is inserted.
|
||||
QwtLegend* legend = new QwtLegend(this);
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <map>
|
||||
@ -39,7 +41,7 @@ namespace cvf
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuResultQwtPlot : public QwtPlot
|
||||
class RiuResultQwtPlot : public RiuDockedQwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user