QwtDateScaleEngine(3)
π QwtDateScaleEngine(3) β Library Functions Manual β¨
okay bestie, welcome to the QwtDateScaleEngine(3) page from the Library Functions Manual. itβs giving βdate/time scale engine main character energy,β and weβre gonna go through literally every detail together. π«Ά
πΈ NAME
QwtDateScaleEngine β a scale engine for date/time values. π
β¨ SYNOPSIS
#include <qwt_date_scale_engine.h>
Inherits QwtLinearScaleEngine.
π Public Member Functions
QwtDateScaleEngine (Qt::TimeSpec=Qt::LocalTime)β Constructor.virtual ~QwtDateScaleEngine ()β Destructor.void setTimeSpec (Qt::TimeSpec)Qt::TimeSpec timeSpec () constvoid setUtcOffset (int seconds)int utcOffset () constvoid setWeek0Type (QwtDate::Week0Type)QwtDate::Week0Type week0Type () constvoid setMaxWeeks (int)int maxWeeks () constvirtual void autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const overridevirtual 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) constQDateTime toDateTime (double) const
π Public Member Functions inherited from QwtLinearScaleEngine
QwtLinearScaleEngine (uint base=10)virtual ~QwtLinearScaleEngine ()β Destructor.
π¦ Public Member Functions inherited from QwtScaleEngine
QwtScaleEngine (uint base=10)virtual ~QwtScaleEngine ()β Destructor.void setBase (uint base)uint base () constvoid setAttribute (Attribute, bool on=true)bool testAttribute (Attribute) constvoid setAttributes (Attributes)Attributes attributes () constvoid setReference (double)β Specify a reference point.double reference () constvoid setMargins (double lower, double upper)β Specify margins at the scaleβs endpoints.double lowerMargin () constdouble upperMargin () constvoid setTransformation (QwtTransform *)QwtTransform * transformation () const
π Protected Member Functions
virtual QDateTime alignDate (const QDateTime &, double stepSize, QwtDate::IntervalType, bool up) const
π 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) constQList< double > strip (const QList< double > &, const QwtInterval &) constdouble divideInterval (double intervalSize, int numSteps) constQwtInterval 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 }typedef QFlags< Attribute > Attributes
π Detailed Description
Okay so: A scale engine for date/time values. Thatβs the whole vibe. π
QwtDateScaleEngine builds scales from a time intervals β yes, thatβs the original wording, bestie β and together with QwtDateScaleDraw it can be used for axes according to date/time values.
Years, months, weeks, days, hours and minutes are organized in steps with non constant intervals. QwtDateScaleEngine classifies intervals and aligns the boundaries and tick positions according to this classification. Slay. β¨
QwtDateScaleEngine supports representations depending on Qt::TimeSpec specifications. The valid range for scales is limited by the range of QDateTime, that differs between Qt4 and Qt5. important detail, no cap.
Datetime values are expected as the number of milliseconds since 1970-01-01T00:00:00 Universal Coordinated Time - also known as βThe Epochβ, that can be converted to QDateTime using QwtDate::toDateTime(). π°οΈ
See also: QwtDate, QwtPlot::setAxisScaleEngine(), QwtAbstractScale::setScaleEngine()
Definition at line 42 of file qwt_date_scale_engine.h.
π Constructor & Destructor Documentation
QwtDateScaleEngine::QwtDateScaleEngine (Qt::TimeSpec timeSpec = Qt::LocalTime) [explicit]
Constructor. The engine is initialized to build scales for the given time specification. It classifies intervals > 4 weeks as >= Qt::Month. The first week of a year is defined like for QwtDate::FirstThursday. πΈ
Parameters:
- timeSpec β Time specification
See also: setTimeSpec(), setMaxWeeks(), setWeek0Type()
Definition at line 747 of file qwt_date_scale_engine.cpp.
QwtDateScaleEngine::~QwtDateScaleEngine () [virtual]
Destructor. bye bestie π
Definition at line 754 of file qwt_date_scale_engine.cpp.
π¦ Member Function Documentation
QDateTime QwtDateScaleEngine::alignDate (const QDateTime & dateTime, double stepSize, QwtDate::IntervalType intervalType, bool up) const [protected], [virtual]
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:
- dateTime β Date/time value
- stepSize β Step size
- intervalType β Interval type
- up β When true dateTime is ceiled - otherwise it is floored
Returns: Aligned date/time value
Definition at line 1108 of file qwt_date_scale_engine.cpp.
void QwtDateScaleEngine::autoScale (int maxNumSteps, double & x1, double & x2, double & stepSize) const [override], [virtual]
Align and divide an interval. π«
The algorithm aligns and divides the interval into steps.
Datetime interval divisions are usually not equidistant and the calculated stepSize can only be used as an approximation for the steps calculated by divideScale(). lowkey important caveat.
Parameters:
- maxNumSteps β Max. number of steps
- x1 β First limit of the interval (In/Out)
- x2 β Second limit of the interval (In/Out)
- stepSize β Step size (Out)
See also: QwtScaleEngine::setAttribute()
Reimplemented from QwtLinearScaleEngine.
Definition at line 925 of file qwt_date_scale_engine.cpp.
QwtScaleDiv QwtDateScaleEngine::divideScale (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize = 0.0) const [override], [virtual]
Calculate a scale division for a date/time interval. π
Parameters:
- x1 β First interval limit
- x2 β Second interval limit
- maxMajorSteps β Maximum for the number of major steps
- maxMinorSteps β Maximum number of minor steps
- stepSize β Step size. If
stepSize == 0, the scaleEngine calculates one.
Returns: Calculated scale division
Reimplemented from QwtLinearScaleEngine.
Definition at line 992 of file qwt_date_scale_engine.cpp.
QwtDate::IntervalType QwtDateScaleEngine::intervalType (const QDateTime & minDate, const QDateTime & maxDate, int maxSteps) const [virtual]
Classification of a date/time interval division. π¦
Parameters:
- minDate β Minimum ( = earlier ) of the interval
- maxDate β Maximum ( = later ) of the interval
- maxSteps β Maximum for the number of steps
Returns: Interval classification
Definition at line 865 of file qwt_date_scale_engine.cpp.
int QwtDateScaleEngine::maxWeeks () const
Returns: Upper limit for the number of weeks, when an interval can be classified as Qt::Week.
See also: setMaxWeeks(), week0Type()
Definition at line 851 of file qwt_date_scale_engine.cpp.
void QwtDateScaleEngine::setMaxWeeks (int weeks)
Set a upper limit for the number of weeks, when an interval can be classified as Qt::Week.
The default setting is 4 weeks.
Parameters:
- weeks β Upper limit for the number of weeks
Note: In business charts a year is often divided into weeks [1-52]
See also: maxWeeks(), setWeek0Type()
Definition at line 841 of file qwt_date_scale_engine.cpp.
void QwtDateScaleEngine::setTimeSpec (Qt::TimeSpec timeSpec)
Set the time specification used by the engine. β°
Parameters:
- timeSpec β Time specification
See also: timeSpec(), setUtcOffset(), toDateTime()
Definition at line 765 of file qwt_date_scale_engine.cpp.
void QwtDateScaleEngine::setUtcOffset (int seconds)
Set the offset in seconds from Coordinated Universal Time. π
Parameters:
- seconds β Offset in seconds
Note: The offset has no effect beside for the time specification Qt::OffsetFromUTC.
See also: QDate::utcOffset(), setTimeSpec(), toDateTime()
Definition at line 789 of file qwt_date_scale_engine.cpp.
void QwtDateScaleEngine::setWeek0Type (QwtDate::Week0Type week0Type)
Sets how to identify the first week of a year. π
Parameters:
- week0Type β Mode how to identify the first week of a year
See also: week0Type(), setMaxWeeks()
Note: week0Type has no effect beside for intervals classified as QwtDate::Week.
Definition at line 815 of file qwt_date_scale_engine.cpp.
Qt::TimeSpec QwtDateScaleEngine::timeSpec () const
Returns: Time specification used by the engine
See also: setTimeSpec(), utcOffset(), toDateTime()
Definition at line 774 of file qwt_date_scale_engine.cpp.
QDateTime QwtDateScaleEngine::toDateTime (double value) const
Translate a double value into a QDateTime object. π«Ά
For QDateTime result is bounded by QwtDate::minDate() and QwtDate::maxDate().
Returns: QDateTime object initialized with timeSpec() and utcOffset().
See also: timeSpec(), utcOffset(), QwtDate::toDateTime()
Definition at line 1298 of file qwt_date_scale_engine.cpp.
int QwtDateScaleEngine::utcOffset () const
Returns: Offset in seconds from Coordinated Universal Time
Note: The offset has no effect beside for the time specification Qt::OffsetFromUTC.
See also: QDate::setUtcOffset(), setTimeSpec(), toDateTime()
Definition at line 801 of file qwt_date_scale_engine.cpp.
QwtDate::Week0Type QwtDateScaleEngine::week0Type () const
Returns: Setting how to identify the first week of a year.
See also: setWeek0Type(), maxWeeks()
Definition at line 824 of file qwt_date_scale_engine.cpp.
π Author
Generated automatically by Doxygen for Qwt Userβs Guide from the source code. β¨
π and thatβs the whole page, bestie β generated automatically by Doxygen for Qwt Userβs Guide from the source code. Footer vibe: Qwt Userβs Guide / QwtDateScaleEngine(3), no date shown on this one, so Iβm not inventing one. byeee ππ
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms