1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
|
.TH "QwtDateScaleEngine" 3 "Wed Jan 2 2019" "Version 6.1.4" "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 <qwt_date_scale_engine\&.h>\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"
.br
.ti -1c
.RI "virtual \fBQwtScaleDiv\fP \fBdivideScale\fP (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0\&.0) const"
.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
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtDateScaleEngine::QwtDateScaleEngine (Qt::TimeSpec timeSpec = \fCQt::LocalTime\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
.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
.SS "void QwtDateScaleEngine::autoScale (int maxNumSteps, double & x1, double & x2, double & stepSize) const\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\&.
.SS "\fBQwtScaleDiv\fP QwtDateScaleEngine::divideScale (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize = \fC0\&.0\fP) const\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\&.
.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
.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
.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
.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
.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
.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
.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
.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
.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
.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
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|