.TH "QwtDateScaleEngine" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtDateScaleEngine \- A scale engine for date/time values\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtLinearScaleEngine\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtDateScaleEngine\fP (Qt::TimeSpec=Qt::LocalTime)" .br .RI "Constructor\&. " .ti -1c .RI "virtual \fB~QwtDateScaleEngine\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "void \fBsetTimeSpec\fP (Qt::TimeSpec)" .br .ti -1c .RI "Qt::TimeSpec \fBtimeSpec\fP () const" .br .ti -1c .RI "void \fBsetUtcOffset\fP (int seconds)" .br .ti -1c .RI "int \fButcOffset\fP () const" .br .ti -1c .RI "void \fBsetWeek0Type\fP (\fBQwtDate::Week0Type\fP)" .br .ti -1c .RI "\fBQwtDate::Week0Type\fP \fBweek0Type\fP () const" .br .ti -1c .RI "void \fBsetMaxWeeks\fP (int)" .br .ti -1c .RI "int \fBmaxWeeks\fP () const" .br .ti -1c .RI "virtual void \fBautoScale\fP (int maxNumSteps, double &x1, double &x2, double &stepSize) const override" .br .ti -1c .RI "virtual \fBQwtScaleDiv\fP \fBdivideScale\fP (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0\&.0) const override" .br .RI "Calculate a scale division for a date/time interval\&. " .ti -1c .RI "virtual \fBQwtDate::IntervalType\fP \fBintervalType\fP (const QDateTime &, const QDateTime &, int maxSteps) const" .br .ti -1c .RI "QDateTime \fBtoDateTime\fP (double) const" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual QDateTime \fBalignDate\fP (const QDateTime &, double stepSize, \fBQwtDate::IntervalType\fP, bool up) const" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP A scale engine for date/time values\&. \fBQwtDateScaleEngine\fP builds scales from a time intervals\&. Together with \fBQwtDateScaleDraw\fP it can be used for axes according to date/time values\&. .PP Years, months, weeks, days, hours and minutes are organized in steps with non constant intervals\&. \fBQwtDateScaleEngine\fP classifies intervals and aligns the boundaries and tick positions according to this classification\&. .PP \fBQwtDateScaleEngine\fP 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\&. .PP 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 \fBQwtDate::toDateTime()\fP\&. .PP \fBSee also\fP .RS 4 \fBQwtDate\fP, \fBQwtPlot::setAxisScaleEngine()\fP, \fBQwtAbstractScale::setScaleEngine()\fP .RE .PP .PP Definition at line 42 of file qwt_date_scale_engine\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtDateScaleEngine::QwtDateScaleEngine (Qt::TimeSpec timeSpec = \fCQt::LocalTime\fP)\fC [explicit]\fP" .PP 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 \fBQwtDate::FirstThursday\fP\&. .PP \fBParameters\fP .RS 4 \fItimeSpec\fP Time specification .RE .PP \fBSee also\fP .RS 4 \fBsetTimeSpec()\fP, \fBsetMaxWeeks()\fP, \fBsetWeek0Type()\fP .RE .PP .PP Definition at line 747 of file qwt_date_scale_engine\&.cpp\&. .SH "Member Function Documentation" .PP .SS "QDateTime QwtDateScaleEngine::alignDate (const QDateTime & dateTime, double stepSize, \fBQwtDate::IntervalType\fP intervalType, bool up) const\fC [protected]\fP, \fC [virtual]\fP" Align a date/time value for a step size .PP 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 ) \fBalignDate()\fP has to be overloaded\&. .PP \fBParameters\fP .RS 4 \fIdateTime\fP Date/time value .br \fIstepSize\fP Step size .br \fIintervalType\fP Interval type .br \fIup\fP When true dateTime is ceiled - otherwise it is floored .RE .PP \fBReturns\fP .RS 4 Aligned date/time value .RE .PP .PP Definition at line 1108 of file qwt_date_scale_engine\&.cpp\&. .SS "void QwtDateScaleEngine::autoScale (int maxNumSteps, double & x1, double & x2, double & stepSize) const\fC [override]\fP, \fC [virtual]\fP" Align and divide an interval .PP The algorithm aligns and divides the interval into steps\&. .PP Datetime interval divisions are usually not equidistant and the calculated stepSize can only be used as an approximation for the steps calculated by \fBdivideScale()\fP\&. .PP \fBParameters\fP .RS 4 \fImaxNumSteps\fP Max\&. number of steps .br \fIx1\fP First limit of the interval (In/Out) .br \fIx2\fP Second limit of the interval (In/Out) .br \fIstepSize\fP Step size (Out) .RE .PP \fBSee also\fP .RS 4 \fBQwtScaleEngine::setAttribute()\fP .RE .PP .PP Reimplemented from \fBQwtLinearScaleEngine\fP\&. .PP Definition at line 925 of file qwt_date_scale_engine\&.cpp\&. .SS "\fBQwtScaleDiv\fP QwtDateScaleEngine::divideScale (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize = \fC0\&.0\fP) const\fC [override]\fP, \fC [virtual]\fP" .PP Calculate a scale division for a date/time interval\&. .PP \fBParameters\fP .RS 4 \fIx1\fP First interval limit .br \fIx2\fP Second interval limit .br \fImaxMajorSteps\fP Maximum for the number of major steps .br \fImaxMinorSteps\fP Maximum number of minor steps .br \fIstepSize\fP Step size\&. If stepSize == 0, the scaleEngine calculates one\&. .RE .PP \fBReturns\fP .RS 4 Calculated scale division .RE .PP .PP Reimplemented from \fBQwtLinearScaleEngine\fP\&. .PP Definition at line 992 of file qwt_date_scale_engine\&.cpp\&. .SS "\fBQwtDate::IntervalType\fP QwtDateScaleEngine::intervalType (const QDateTime & minDate, const QDateTime & maxDate, int maxSteps) const\fC [virtual]\fP" Classification of a date/time interval division .PP \fBParameters\fP .RS 4 \fIminDate\fP Minimum ( = earlier ) of the interval .br \fImaxDate\fP Maximum ( = later ) of the interval .br \fImaxSteps\fP Maximum for the number of steps .RE .PP \fBReturns\fP .RS 4 Interval classification .RE .PP .PP Definition at line 865 of file qwt_date_scale_engine\&.cpp\&. .SS "int QwtDateScaleEngine::maxWeeks () const" .PP \fBReturns\fP .RS 4 Upper limit for the number of weeks, when an interval can be classified as Qt::Week\&. .RE .PP \fBSee also\fP .RS 4 \fBsetMaxWeeks()\fP, \fBweek0Type()\fP .RE .PP .PP Definition at line 851 of file qwt_date_scale_engine\&.cpp\&. .SS "void QwtDateScaleEngine::setMaxWeeks (int weeks)" Set a upper limit for the number of weeks, when an interval can be classified as Qt::Week\&. .PP The default setting is 4 weeks\&. .PP \fBParameters\fP .RS 4 \fIweeks\fP Upper limit for the number of weeks .RE .PP \fBNote\fP .RS 4 In business charts a year is often divided into weeks [1-52] .RE .PP \fBSee also\fP .RS 4 \fBmaxWeeks()\fP, \fBsetWeek0Type()\fP .RE .PP .PP Definition at line 841 of file qwt_date_scale_engine\&.cpp\&. .SS "void QwtDateScaleEngine::setTimeSpec (Qt::TimeSpec timeSpec)" Set the time specification used by the engine .PP \fBParameters\fP .RS 4 \fItimeSpec\fP Time specification .RE .PP \fBSee also\fP .RS 4 \fBtimeSpec()\fP, \fBsetUtcOffset()\fP, \fBtoDateTime()\fP .RE .PP .PP Definition at line 765 of file qwt_date_scale_engine\&.cpp\&. .SS "void QwtDateScaleEngine::setUtcOffset (int seconds)" Set the offset in seconds from Coordinated Universal Time .PP \fBParameters\fP .RS 4 \fIseconds\fP Offset in seconds .RE .PP \fBNote\fP .RS 4 The offset has no effect beside for the time specification Qt::OffsetFromUTC\&. .RE .PP \fBSee also\fP .RS 4 QDate::utcOffset(), \fBsetTimeSpec()\fP, \fBtoDateTime()\fP .RE .PP .PP Definition at line 789 of file qwt_date_scale_engine\&.cpp\&. .SS "void QwtDateScaleEngine::setWeek0Type (\fBQwtDate::Week0Type\fP week0Type)" Sets how to identify the first week of a year\&. .PP \fBParameters\fP .RS 4 \fIweek0Type\fP Mode how to identify the first week of a year .RE .PP \fBSee also\fP .RS 4 \fBweek0Type()\fP, \fBsetMaxWeeks()\fP .RE .PP \fBNote\fP .RS 4 week0Type has no effect beside for intervals classified as \fBQwtDate::Week\fP\&. .RE .PP .PP Definition at line 815 of file qwt_date_scale_engine\&.cpp\&. .SS "Qt::TimeSpec QwtDateScaleEngine::timeSpec () const" .PP \fBReturns\fP .RS 4 Time specification used by the engine .RE .PP \fBSee also\fP .RS 4 \fBsetTimeSpec()\fP, \fButcOffset()\fP, \fBtoDateTime()\fP .RE .PP .PP Definition at line 774 of file qwt_date_scale_engine\&.cpp\&. .SS "QDateTime QwtDateScaleEngine::toDateTime (double value) const" Translate a double value into a QDateTime object\&. .PP For QDateTime result is bounded by \fBQwtDate::minDate()\fP and \fBQwtDate::maxDate()\fP .PP \fBReturns\fP .RS 4 QDateTime object initialized with \fBtimeSpec()\fP and \fButcOffset()\fP\&. .RE .PP \fBSee also\fP .RS 4 \fBtimeSpec()\fP, \fButcOffset()\fP, \fBQwtDate::toDateTime()\fP .RE .PP .PP Definition at line 1298 of file qwt_date_scale_engine\&.cpp\&. .SS "int QwtDateScaleEngine::utcOffset () const" .PP \fBReturns\fP .RS 4 Offset in seconds from Coordinated Universal Time .RE .PP \fBNote\fP .RS 4 The offset has no effect beside for the time specification Qt::OffsetFromUTC\&. .RE .PP \fBSee also\fP .RS 4 QDate::setUtcOffset(), \fBsetTimeSpec()\fP, \fBtoDateTime()\fP .RE .PP .PP Definition at line 801 of file qwt_date_scale_engine\&.cpp\&. .SS "\fBQwtDate::Week0Type\fP QwtDateScaleEngine::week0Type () const" .PP \fBReturns\fP .RS 4 Setting how to identify the first week of a year\&. .RE .PP \fBSee also\fP .RS 4 \fBsetWeek0Type()\fP, \fBmaxWeeks()\fP .RE .PP .PP Definition at line 824 of file qwt_date_scale_engine\&.cpp\&. .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.