QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
QwtDateScaleEngine Class Reference

A scale engine for date/time values. More...

#include <qwt_date_scale_engine.h>

Inheritance diagram for QwtDateScaleEngine:
QwtLinearScaleEngine QwtScaleEngine

Classes

class  PrivateData
 

Public Member Functions

 QwtDateScaleEngine (Qt::TimeSpec=Qt::LocalTime)
 Constructor with time specification.
 
virtual ~QwtDateScaleEngine ()
 Destructor.
 
void setTimeSpec (Qt::TimeSpec)
 Set the time specification used by the engine.
 
Qt::TimeSpec timeSpec () const
 Get the time specification used by the engine.
 
void setUtcOffset (int seconds)
 Set the offset in seconds from Coordinated Universal Time.
 
int utcOffset () const
 Get the offset in seconds from Coordinated Universal Time.
 
void setWeek0Type (QwtDate::Week0Type)
 Set how to identify the first week of a year.
 
QwtDate::Week0Type week0Type () const
 Get how to identify the first week of a year.
 
void setMaxWeeks (int)
 Set upper limit for the number of weeks.
 
int maxWeeks () const
 Get upper limit for the number of weeks.
 
virtual void autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const override
 Align and divide an interval.
 
virtual QwtScaleDiv divideScale (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const override
 Calculate a scale division for a date/time interval.
 
virtual QwtDate::IntervalType intervalType (const QDateTime &, const QDateTime &, int maxSteps) const
 Classification of a date/time interval division.
 
QDateTime toDateTime (double) const
 Translate a double value into a QDateTime object.
 
- Public Member Functions inherited from QwtLinearScaleEngine
 QwtLinearScaleEngine (uint base=10)
 Constructor.
 
virtual ~QwtLinearScaleEngine ()
 Destructor.
 
- Public Member Functions inherited from QwtScaleEngine
 QwtScaleEngine (uint base=10)
 Constructor.
 
virtual ~QwtScaleEngine ()
 Destructor.
 
void setBase (uint base)
 Set the base.
 
uint base () const
 Return base of the scale engine.
 
void setAttribute (Attribute, bool on=true)
 Set an attribute.
 
bool testAttribute (Attribute) const
 Test if an attribute is enabled.
 
void setAttributes (Attributes)
 Set attributes.
 
Attributes attributes () const
 Return scale attributes.
 
void setReference (double)
 Set the reference value.
 
double reference () const
 Return the reference value.
 
void setMargins (double lower, double upper)
 Set the margins.
 
double lowerMargin () const
 Return the margin at the lower end of the scale.
 
double upperMargin () const
 Return the margin at the upper end of the scale.
 
void setTransformation (QwtTransform *)
 Set the transformation.
 
QwtTransformtransformation () const
 Create and return a clone of the transformation of the engine.
 

Protected Member Functions

virtual QDateTime alignDate (const QDateTime &, double stepSize, QwtDate::IntervalType, bool up) const
 Align a date/time value for a step size.
 
- Protected Member Functions inherited from QwtLinearScaleEngine
QwtInterval align (const QwtInterval &, double stepSize) const
 Align an interval to a step size.
 
void buildTicks (const QwtInterval &, double stepSize, int maxMinorSteps, QList< double > ticks[QwtScaleDiv::NTickTypes]) const
 Calculate ticks for an interval.
 
QList< double > buildMajorTicks (const QwtInterval &interval, double stepSize) const
 Calculate major ticks for an interval.
 
void buildMinorTicks (const QList< double > &majorTicks, int maxMinorSteps, double stepSize, QList< double > &minorTicks, QList< double > &mediumTicks) const
 Calculate minor/medium ticks for major ticks.
 
- Protected Member Functions inherited from QwtScaleEngine
bool contains (const QwtInterval &, double value) const
 Check if an interval contains a value.
 
QList< double > strip (const QList< double > &, const QwtInterval &) const
 Strip values outside an interval.
 
double divideInterval (double intervalSize, int numSteps) const
 Divide an interval.
 
QwtInterval buildInterval (double value) const
 Build an interval around a value.
 

Additional Inherited Members

- Public Types inherited from QwtScaleEngine
enum  Attribute {
  NoAttribute = 0x00 , IncludeReference = 0x01 , Symmetric = 0x02 , Floating = 0x04 ,
  Inverted = 0x08
}
 Layout attributes. More...
 

Detailed Description

A scale engine for date/time values.

Constructor & Destructor Documentation

◆ QwtDateScaleEngine()

QwtDateScaleEngine::QwtDateScaleEngine ( Qt::TimeSpec  timeSpec = Qt::LocalTime)
explicit

Constructor with time specification.

Constructor.

◆ ~QwtDateScaleEngine()

QwtDateScaleEngine::~QwtDateScaleEngine ( )
virtual

Destructor.

Destructor

.

Member Function Documentation

◆ alignDate()

QDateTime QwtDateScaleEngine::alignDate ( const QDateTime &  dateTime,
double  stepSize,
QwtDate::IntervalType  intervalType,
bool  up 
) const
protectedvirtual

Align a date/time value for a step size.

For Qt::Day alignments there is no "natural day 0" - instead the first day of the year is used to avoid jumping major ticks positions when panning a scale. For other alignments ( f.e according to the first day of the month ) alignDate() has to be overloaded.

Parameters
dateTimeDate/time value
stepSizeStep size
intervalTypeInterval type
upWhen true dateTime is ceiled - otherwise it is floored
Returns
Aligned date/time value

◆ autoScale()

void QwtDateScaleEngine::autoScale ( int  maxNumSteps,
double &  x1,
double &  x2,
double &  stepSize 
) const
overridevirtual

Align and divide an interval.

Reimplemented from QwtLinearScaleEngine.

◆ divideScale()

QwtScaleDiv QwtDateScaleEngine::divideScale ( double  x1,
double  x2,
int  maxMajorSteps,
int  maxMinorSteps,
double  stepSize = 0.0 
) const
overridevirtual

Calculate a scale division for a date/time interval.

Reimplemented from QwtLinearScaleEngine.

◆ intervalType()

QwtDate::IntervalType QwtDateScaleEngine::intervalType ( const QDateTime &  minDate,
const QDateTime &  maxDate,
int  maxSteps 
) const
virtual

Classification of a date/time interval division.

◆ maxWeeks()

int QwtDateScaleEngine::maxWeeks ( ) const

Get upper limit for the number of weeks.

Get the upper limit for the number of weeks.

◆ setMaxWeeks()

void QwtDateScaleEngine::setMaxWeeks ( int  weeks)

Set upper limit for the number of weeks.

Set an upper limit for the number of weeks.

◆ setTimeSpec()

void QwtDateScaleEngine::setTimeSpec ( Qt::TimeSpec  timeSpec)

Set the time specification used by the engine.

◆ setUtcOffset()

void QwtDateScaleEngine::setUtcOffset ( int  seconds)

Set the offset in seconds from Coordinated Universal Time.

◆ setWeek0Type()

void QwtDateScaleEngine::setWeek0Type ( QwtDate::Week0Type  week0Type)

Set how to identify the first week of a year.

◆ timeSpec()

Qt::TimeSpec QwtDateScaleEngine::timeSpec ( ) const

Get the time specification used by the engine.

◆ toDateTime()

QDateTime QwtDateScaleEngine::toDateTime ( double  value) const

Translate a double value into a QDateTime object.

◆ utcOffset()

int QwtDateScaleEngine::utcOffset ( ) const

Get the offset in seconds from Coordinated Universal Time.

◆ week0Type()

QwtDate::Week0Type QwtDateScaleEngine::week0Type ( ) const

Get how to identify the first week of a year.


The documentation for this class was generated from the following files: