QwtScaleDiv - A class representing a scale division.
Contents
Constructor & Destructor Documentation
QwtScaleDiv::QwtScaleDiv(doublelowerBound=0.0,doubleupperBound=0.0)[explicit]
Construct a division without ticks
Parameters:lowerBound First boundary
upperBound Second boundary
Note:
lowerBound might be greater than upperBound for inverted scales
QwtScaleDiv::QwtScaleDiv(constQwtInterval&interval,QList<double>ticks[NTickTypes])[explicit]
Construct a scale division
Parameters:interval Interval
ticks List of major, medium and minor ticks
QwtScaleDiv::QwtScaleDiv(doublelowerBound,doubleupperBound,QList<double>ticks[NTickTypes])[explicit]
Construct a scale division
Parameters:lowerBound First boundary
upperBound Second boundary
ticks List of major, medium and minor ticks
Note:
lowerBound might be greater than upperBound for inverted scales
QwtScaleDiv::QwtScaleDiv(doublelowerBound,doubleupperBound,constQList<double>&minorTicks,constQList<double>&mediumTicks,constQList<double>&majorTicks)[explicit]
Construct a scale division
Parameters:lowerBound First boundary
upperBound Second boundary
minorTicks List of minor ticks
mediumTicks List medium ticks
majorTicks List of major ticks
Note:
lowerBound might be greater than upperBound for inverted scales
Detailed Description
A class representing a scale division.
A Qwt scale is defined by its boundaries and 3 list for the positions of the major, medium and minor
ticks.
The upperBound() might be smaller than the lowerBound() to indicate inverted scales.
Scale divisions can be calculated from a QwtScaleEngine.
Seealso:QwtScaleEngine::divideScale(), QwtPlot::setAxisScaleDiv(), QwtAbstractSlider::setScaleDiv()
Member Enumeration Documentation
enumQwtScaleDiv::TickType
Scale tick types.
EnumeratorNoTick No ticks.
MinorTick
Minor ticks.
MediumTick
Medium ticks.
MajorTick
Major ticks.
NTickTypes
Number of valid tick types.
Member Function Documentation
QwtScaleDivQwtScaleDiv::bounded(doublelowerBound,doubleupperBound)const
Return a scale division with an interval [lowerBound, upperBound] where all ticks outside this interval
are removed
Parameters:lowerBound Lower bound
upperBound Upper bound
Returns:
Scale division with all ticks inside of the given interval
Note:
lowerBound might be greater than upperBound for inverted scales
boolQwtScaleDiv::contains(doublevalue)const
Return if a value is between lowerBound() and upperBound()Parameters:value Value
Returns:
true/false
QwtIntervalQwtScaleDiv::interval()constReturns:
lowerBound -> upperBound
voidQwtScaleDiv::invert()
Invert the scale division
Seealso:inverted()QwtScaleDivQwtScaleDiv::inverted()constReturns:
A scale division with inverted boundaries and ticks
Seealso:invert()doubleQwtScaleDiv::lowerBound()constReturns:
First boundary
Seealso:upperBound()boolQwtScaleDiv::operator!=(constQwtScaleDiv&other)const
Inequality.
Returns:
true if this instance is not equal to other
boolQwtScaleDiv::operator==(constQwtScaleDiv&other)const
Equality operator.
Returns:
true if this instance is equal to other
doubleQwtScaleDiv::range()constReturns:upperBound() - lowerBound()voidQwtScaleDiv::setInterval(doublelowerBound,doubleupperBound)
Change the interval
Parameters:lowerBound First boundary
upperBound Second boundary
Note:
lowerBound might be greater than upperBound for inverted scales
voidQwtScaleDiv::setInterval(constQwtInterval&interval)
Change the interval
Parameters:interval Interval
voidQwtScaleDiv::setLowerBound(doublelowerBound)
Set the first boundary
Parameters:lowerBound First boundary
Seealso:
lowerBiound(), setUpperBound()voidQwtScaleDiv::setTicks(inttype,constQList<double>&ticks)
Assign ticks
Parameters:type MinorTick, MediumTick or MajorTick
ticks Values of the tick positions
voidQwtScaleDiv::setUpperBound(doubleupperBound)
Set the second boundary
Parameters:upperBound Second boundary
Seealso:upperBound(), setLowerBound()QList<double>QwtScaleDiv::ticks(inttype)const
Return a list of ticks
Parameters:type MinorTick, MediumTick or MajorTick
Returns:
Tick list
doubleQwtScaleDiv::upperBound()constReturns:
upper bound
Seealso:lowerBound()Name
QwtScaleDiv - A class representing a scale division.
Synopsis
#include <qwt_scale_div.h>
PublicTypes
enum TickType { NoTick = -1, MinorTick, MediumTick, MajorTick, NTickTypes }
Scale tick types.
PublicMemberFunctionsQwtScaleDiv (double lowerBound=0.0, double upperBound=0.0)
QwtScaleDiv (const QwtInterval &, QList< double >[NTickTypes])
QwtScaleDiv (double lowerBound, double upperBound, QList< double >[NTickTypes])
QwtScaleDiv (double lowerBound, double upperBound, const QList< double > &minorTicks, const QList< double
> &mediumTicks, const QList< double > &majorTicks)
bool operator== (const QwtScaleDiv &) const
Equality operator.
bool operator!= (const QwtScaleDiv &) const
Inequality.
void setInterval (double lowerBound, double upperBound)
void setInterval (const QwtInterval &)
QwtIntervalinterval () const
void setLowerBound (double)
double lowerBound () const
void setUpperBound (double)
double upperBound () const
double range () const
bool contains (double value) const
void setTicks (int tickType, const QList< double > &)
QList< double > ticks (int tickType) const
bool isEmpty () const
Check if the scale division is empty( lowerBound() == upperBound() )
bool isIncreasing () const
Check if the scale division is increasing( lowerBound() <= upperBound() )
void invert ()
QwtScaleDivinverted () const
QwtScaleDivbounded (double lowerBound, double upperBound) const
