QDateTimeQwtDateScaleEngine::alignDate(constQDateTime&dateTime,doublestepSize,QwtDate::IntervalTypeintervalType,boolup)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
voidQwtDateScaleEngine::autoScale(intmaxNumSteps,double&x1,double&x2,double&stepSize)const[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().
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)
Seealso:QwtScaleEngine::setAttribute()
Reimplemented from QwtLinearScaleEngine.
QwtScaleDivQwtDateScaleEngine::divideScale(doublex1,doublex2,intmaxMajorSteps,intmaxMinorSteps,doublestepSize=0.0)const[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.
QwtDate::IntervalTypeQwtDateScaleEngine::intervalType(constQDateTime&minDate,constQDateTime&maxDate,intmaxSteps)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
intQwtDateScaleEngine::maxWeeks()constReturns:
Upper limit for the number of weeks, when an interval can be classified as Qt::Week.
Seealso:setMaxWeeks(), week0Type()voidQwtDateScaleEngine::setMaxWeeks(intweeks)
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]
Seealso:maxWeeks(), setWeek0Type()voidQwtDateScaleEngine::setTimeSpec(Qt::TimeSpectimeSpec)
Set the time specification used by the engine
Parameters:timeSpec Time specification
Seealso:timeSpec(), setUtcOffset(), toDateTime()voidQwtDateScaleEngine::setUtcOffset(intseconds)
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.
Seealso:
QDate::utcOffset(), setTimeSpec(), toDateTime()voidQwtDateScaleEngine::setWeek0Type(QwtDate::Week0Typeweek0Type)
Sets how to identify the first week of a year.
Parameters:week0Type Mode how to identify the first week of a year
Seealso:week0Type(), setMaxWeeks()Note:
week0Type has no effect beside for intervals classified as QwtDate::Week.
Qt::TimeSpecQwtDateScaleEngine::timeSpec()constReturns:
Time specification used by the engine
Seealso:setTimeSpec(), utcOffset(), toDateTime()QDateTimeQwtDateScaleEngine::toDateTime(doublevalue)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().
Seealso:timeSpec(), utcOffset(), QwtDate::toDateTime()intQwtDateScaleEngine::utcOffset()constReturns:
Offset in seconds from Coordinated Universal Time
Note:
The offset has no effect beside for the time specification Qt::OffsetFromUTC.
Seealso:
QDate::setUtcOffset(), setTimeSpec(), toDateTime()QwtDate::Week0TypeQwtDateScaleEngine::week0Type()constReturns:
Setting how to identify the first week of a year.
Seealso:setWeek0Type(), maxWeeks()