10#include "qwt_date_scale_draw.h"
13class QwtDateScaleDraw::PrivateData
16 explicit PrivateData( Qt::TimeSpec spec )
19 , week0Type(
QwtDate::FirstThursday )
31 Qt::TimeSpec timeSpec;
50 m_data =
new PrivateData(
timeSpec );
76 return m_data->timeSpec;
91 m_data->utcOffset = seconds;
103 return m_data->utcOffset;
126 return m_data->week0Type;
228 bool alignedToWeeks =
true;
231 for (
int i = 0; i < ticks.size(); i++ )
243 alignedToWeeks =
false;
272 if ( m_data->timeSpec == Qt::OffsetFromUTC )
274 dt = dt.addSecs( m_data->utcOffset );
275#if QT_VERSION >= 0x050200
276 dt.setOffsetFromUtc( m_data->utcOffset );
278 dt.setUtcOffset( m_data->utcOffset );
const QwtScaleDiv & scaleDiv() const
A collection of methods around date/time values.
static QDateTime floor(const QDateTime &, IntervalType)
static QString toString(const QDateTime &, const QString &format, Week0Type)
static QDateTime toDateTime(double value, Qt::TimeSpec=Qt::UTC)
@ Month
The interval is related to months.
@ Day
The interval is related to days.
@ Millisecond
The interval is related to milliseconds.
@ Minute
The interval is related to minutes.
@ Hour
The interval is related to hours.
@ Second
The interval is related to seconds.
@ Week
The interval is related to weeks.
@ Year
The interval is related to years.
QDateTime toDateTime(double) const
virtual QwtDate::IntervalType intervalType(const QwtScaleDiv &) const
void setTimeSpec(Qt::TimeSpec)
QString dateFormat(QwtDate::IntervalType) const
void setUtcOffset(int seconds)
virtual QString dateFormatOfDate(const QDateTime &, QwtDate::IntervalType) const
void setWeek0Type(QwtDate::Week0Type)
virtual QwtText label(double) const override
Convert a value into its representing label.
QwtDateScaleDraw(Qt::TimeSpec=Qt::LocalTime)
Constructor.
void setDateFormat(QwtDate::IntervalType, const QString &)
virtual ~QwtDateScaleDraw()
Destructor.
QwtDate::Week0Type week0Type() const
Qt::TimeSpec timeSpec() const
A class representing a scale division.
QList< double > ticks(int tickType) const
A class representing a text.