10#include "qwt_abstract_scale.h"
11#include "qwt_scale_engine.h"
12#include "qwt_scale_draw.h"
13#include "qwt_scale_div.h"
14#include "qwt_scale_map.h"
15#include "qwt_interval.h"
17#include <qcoreevent.h>
19class QwtAbstractScale::PrivateData
60 m_data =
new PrivateData;
61 rescale( 0.0, 100.0, m_data->stepSize );
163 if ( m_data->scaleEngine )
191 if ( ticks != m_data->maxMajor )
193 m_data->maxMajor = ticks;
204 return m_data->maxMajor;
221 if ( ticks != m_data->maxMinor )
223 m_data->maxMinor = ticks;
234 return m_data->maxMinor;
253 if ( stepSize != m_data->stepSize )
255 m_data->stepSize = stepSize;
266 return m_data->stepSize;
279 if ( scaleDraw == NULL || scaleDraw == m_data->scaleDraw )
282 if ( m_data->scaleDraw != NULL )
285 delete m_data->scaleDraw;
286 m_data->scaleDraw = scaleDraw;
295 return m_data->scaleDraw;
304 return m_data->scaleDraw;
320 delete m_data->scaleEngine;
331 return m_data->scaleEngine;
340 return m_data->scaleEngine;
351 return m_data->scaleDraw->
scaleDiv();
359 return m_data->scaleDraw->
scaleMap();
430 double lowerBound,
double upperBound,
double stepSize )
455 if ( event->type() == QEvent::LocaleChange )
460 QWidget::changeEvent( event );
472#include "moc_qwt_abstract_scale.cpp"
A abstract base class for drawing scales.
void setScaleDiv(const QwtScaleDiv &)
const QwtScaleMap & scaleMap() const
void setTransformation(QwtTransform *)
const QwtScaleDiv & scaleDiv() const
virtual void scaleChange()
Notify changed scale.
const QwtScaleMap & scaleMap() const
void setUpperBound(double value)
void setScaleMaxMajor(int ticks)
Set the maximum number of major tick intervals.
double lowerBound() const
const QwtAbstractScaleDraw * abstractScaleDraw() const
double invTransform(int) const
const QwtScaleEngine * scaleEngine() const
void rescale(double lowerBound, double upperBound, double stepSize)
void setScaleMaxMinor(int ticks)
Set the maximum number of minor tick intervals.
const QwtScaleDiv & scaleDiv() const
double scaleStepSize() const
int transform(double) const
virtual ~QwtAbstractScale()
Destructor.
void setAbstractScaleDraw(QwtAbstractScaleDraw *)
Set a scale draw.
int scaleMaxMajor() const
QwtAbstractScale(QWidget *parent=NULL)
void setScaleEngine(QwtScaleEngine *)
Set a scale engine.
void setLowerBound(double value)
void setScaleStepSize(double stepSize)
Set the step size used for calculating a scale division.
double upperBound() const
int scaleMaxMinor() const
void setScale(double lowerBound, double upperBound)
Specify a scale.
virtual void changeEvent(QEvent *) override
A class representing an interval.
A scale engine for linear scales.
A class representing a scale division.
double lowerBound() const
double upperBound() const
A class for drawing scales.
Base class for scale engines.
QwtTransform * transformation() const
virtual QwtScaleDiv divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const =0
Calculate a scale division.
double transform(double s) const
double invTransform(double p) const