mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1375 Reduced window zoom limit to 10 decades instead of 4
This commit is contained in:
parent
e679b551c9
commit
e5f593db60
@ -23,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RiuPropertyViewTabWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuQwtCurvePointTracker.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuQwtPlotWheelZoomer.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuQwtPlotZoomer.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuRecentFileActionProvider.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuResultInfoPanel.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuResultQwtPlot.h
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "qwt_plot_zoneitem.h"
|
||||
#include "qwt_date.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
|
||||
|
||||
|
||||
@ -86,7 +87,7 @@ RiuFlowCharacteristicsPlot::RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlo
|
||||
|
||||
void RiuFlowCharacteristicsPlot::addWindowZoom(QwtPlot* plot)
|
||||
{
|
||||
auto zoomer = new QwtPlotZoomer(plot->canvas());
|
||||
auto zoomer = new RiuQwtPlotZoomer(plot->canvas());
|
||||
zoomer->setRubberBandPen(QColor(Qt::black));
|
||||
zoomer->setTrackerMode(QwtPicker::AlwaysOff);
|
||||
zoomer->setTrackerPen(QColor(Qt::black));
|
||||
|
35
ApplicationCode/UserInterface/RiuQwtPlotZoomer.h
Normal file
35
ApplicationCode/UserInterface/RiuQwtPlotZoomer.h
Normal file
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil 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_zoomer.h"
|
||||
|
||||
class RiuQwtPlotZoomer : public QwtPlotZoomer
|
||||
{
|
||||
public:
|
||||
RiuQwtPlotZoomer(QWidget * canvas, bool doReplot=true) : QwtPlotZoomer(canvas, doReplot) {}
|
||||
|
||||
protected:
|
||||
virtual QSizeF minZoomSize() const override
|
||||
{
|
||||
return QwtPlotZoomer::minZoomSize() / 10.0e6;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include <float.h>
|
||||
#include "qwt_plot_magnifier.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -59,14 +60,14 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot(RimSummaryPlot* plotDefinition, QWidget* pa
|
||||
setDefaults();
|
||||
|
||||
// LeftButton for the zooming
|
||||
m_zoomerLeft = new QwtPlotZoomer(canvas());
|
||||
m_zoomerLeft = new RiuQwtPlotZoomer(canvas());
|
||||
m_zoomerLeft->setRubberBandPen(QColor(Qt::black));
|
||||
m_zoomerLeft->setTrackerMode(QwtPicker::AlwaysOff);
|
||||
m_zoomerLeft->setTrackerPen(QColor(Qt::black));
|
||||
m_zoomerLeft->initMousePattern(1);
|
||||
|
||||
// Attach a zoomer for the right axis
|
||||
m_zoomerRight = new QwtPlotZoomer(canvas());
|
||||
m_zoomerRight = new RiuQwtPlotZoomer(canvas());
|
||||
m_zoomerRight->setAxis(xTop, yRight);
|
||||
m_zoomerRight->setTrackerMode(QwtPicker::AlwaysOff);
|
||||
m_zoomerRight->initMousePattern(1);
|
||||
|
Loading…
Reference in New Issue
Block a user