mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
#13813 Remove duplicated snapshotWindowContent overrides that replicate base class behavior
This commit is contained in:
1 parent
5921c44be0
commit
ba1055fbc4
30 files changed
+31
-254
No files matched your search
@@ -798,22 +798,6 @@ void RimAnalysisPlot::onLoadDataAndUpdate()
|
||||
updatePlotTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimAnalysisPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -119,7 +119,6 @@ private:
|
||||
void deleteViewWidget() override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void zoomAll() override {}
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
// RimPlotWindow overrides
|
||||
|
||||
|
||||
@@ -536,22 +536,6 @@ void RimAbstractCorrelationPlot::deleteViewWidget()
|
||||
cleanupBeforeClose();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimAbstractCorrelationPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -98,7 +98,6 @@ protected:
|
||||
QWidget* viewWidget() override;
|
||||
void deleteViewWidget() override;
|
||||
void zoomAll() override {}
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
// RimPlotWindow overrides
|
||||
QString description() const override;
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
|
||||
#include <QContextMenuEvent>
|
||||
#include <QFrame>
|
||||
#include <QImage>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QVBoxLayout>
|
||||
@@ -282,22 +281,6 @@ QString RimCorrelationReportPlot::description() const
|
||||
return createDescription();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimCorrelationReportPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_viewWidget )
|
||||
{
|
||||
QPixmap pix = m_viewWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,7 +52,6 @@ public:
|
||||
|
||||
QWidget* viewWidget() override;
|
||||
QString description() const override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override;
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
@@ -580,22 +580,6 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimFlowCharacteristicsPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_flowCharPlotWidget )
|
||||
{
|
||||
QPixmap pix = m_flowCharPlotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -86,11 +86,6 @@ public:
|
||||
void updateFonts() override;
|
||||
|
||||
protected:
|
||||
// RimViewWindow overrides
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
// Overridden PDM methods
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
@@ -235,22 +235,6 @@ QWidget* RimWellAllocationOverTimePlot::viewWidget()
|
||||
return plotWidget();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellAllocationOverTimePlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
|
||||
// RimViewWindow implementations
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override {};
|
||||
|
||||
void zoomAll() override {};
|
||||
|
||||
private:
|
||||
// RimPlot implementations
|
||||
|
||||
@@ -815,22 +815,6 @@ std::set<QString> RimWellAllocationPlot::findSortedWellNames()
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellAllocationPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_wellAllocationPlotWidget )
|
||||
{
|
||||
QPixmap pix = m_wellAllocationPlotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -103,8 +103,6 @@ protected:
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
|
||||
@@ -766,22 +766,6 @@ QWidget* RimWellConnectivityTable::viewWidget()
|
||||
return m_matrixPlotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellConnectivityTable::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_matrixPlotWidget )
|
||||
{
|
||||
QPixmap pix = m_matrixPlotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
|
||||
// Inherited via RimViewWindow
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void zoomAll() override;
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
@@ -228,24 +228,6 @@ QWidget* RimWellDistributionPlot::viewWidget()
|
||||
return m_plotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellDistributionPlot::snapshotWindowContent()
|
||||
{
|
||||
// cvf::Trace::show("RimWellDistributionPlot::snapshotWindowContent()");
|
||||
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -66,8 +66,8 @@ public:
|
||||
|
||||
// RimViewWindow implementations
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override;
|
||||
|
||||
void zoomAll() override;
|
||||
|
||||
private:
|
||||
// RimViewWindow implementations
|
||||
|
||||
@@ -145,22 +145,6 @@ RiuPlotWidget* RimGridCrossPlot::plotWidget()
|
||||
return m_plotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimGridCrossPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -73,7 +73,6 @@ public:
|
||||
QWidget* viewWidget() override;
|
||||
RiuPlotWidget* plotWidget() override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override;
|
||||
void calculateZoomRangeAndUpdateQwt();
|
||||
QString createAutoName() const override;
|
||||
|
||||
@@ -637,22 +637,6 @@ void RimHistogramPlot::updateStackedCurveData()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimHistogramPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( plotWidget() )
|
||||
{
|
||||
QPixmap pix = plotWidget()->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -181,8 +181,6 @@ protected:
|
||||
|
||||
void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void initAfterRead() override;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "cafPdmUiTreeViewEditor.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QImage>
|
||||
#include <QPixmap>
|
||||
#include <QWidget>
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimViewWindow, "ViewWindow" ); // Do not use. Abstract class
|
||||
@@ -206,6 +208,23 @@ RimMdiWindowGeometry RimViewWindow::mdiWindowGeometry()
|
||||
return RimMdiWindowGeometry();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimViewWindow::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
QWidget* widget = viewWidget();
|
||||
if ( widget )
|
||||
{
|
||||
QPixmap pix = widget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -79,8 +79,8 @@ public:
|
||||
|
||||
virtual QWidget* viewWidget() = 0;
|
||||
|
||||
virtual QImage snapshotWindowContent() = 0;
|
||||
virtual void zoomAll() = 0;
|
||||
virtual QImage snapshotWindowContent();
|
||||
virtual void zoomAll() = 0;
|
||||
|
||||
void viewNavigationChanged();
|
||||
|
||||
|
||||
@@ -1736,22 +1736,6 @@ bool RimSummaryPlot::updateStackedCurveDataForAxis( RiuPlotAxis plotAxis )
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimSummaryPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( plotWidget() )
|
||||
{
|
||||
QPixmap pix = plotWidget()->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -246,8 +246,6 @@ protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
bool handleGlobalKeyEvent( QKeyEvent* keyEvent ) override;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -511,22 +511,6 @@ QWidget* RimSummaryTable::viewWidget()
|
||||
return m_matrixPlotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimSummaryTable::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_matrixPlotWidget )
|
||||
{
|
||||
QPixmap pix = m_matrixPlotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
|
||||
// Inherited via RimViewWindow
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void zoomAll() override;
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
@@ -482,22 +482,6 @@ QWidget* RimCustomVfpPlot::viewWidget()
|
||||
return m_plotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimCustomVfpPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -89,8 +89,8 @@ public:
|
||||
|
||||
// RimViewWindow implementations
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override;
|
||||
|
||||
void zoomAll() override;
|
||||
|
||||
private:
|
||||
void onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects ) override;
|
||||
|
||||
@@ -1748,22 +1748,6 @@ RiuPlotWidget* RimWellLogTrack::plotWidget()
|
||||
return m_plotWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellLogTrack::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QPixmap pix = m_plotWidget->grab();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -94,8 +94,8 @@ public:
|
||||
QWidget* viewWidget() override;
|
||||
RiuQwtPlotWidget* viewer();
|
||||
RiuPlotWidget* plotWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override;
|
||||
|
||||
void zoomAll() override;
|
||||
|
||||
QString description() const override;
|
||||
void setDescription( const QString& description );
|
||||
|
||||
Reference in new issue
Block a user