Qwt User's Guide: qwt_date_scale_engine.h Source File

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_date_scale_engine.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_DATE_SCALE_ENGINE_H
11#define QWT_DATE_SCALE_ENGINE_H
12
13#include "qwt_global.h"
14#include "qwt_date.h"
15#include "qwt_scale_engine.h"
16
42 class QWT_EXPORT QwtDateScaleEngine : public QwtLinearScaleEngine
43{
44 public:
45 explicit QwtDateScaleEngine( Qt::TimeSpec = Qt::LocalTime );
46 virtual ~QwtDateScaleEngine();
47
48 void setTimeSpec( Qt::TimeSpec );
49 Qt::TimeSpec timeSpec() const;
50
51 void setUtcOffset( int seconds );
52 int utcOffset() const;
53
54 void setWeek0Type( QwtDate::Week0Type );
55 QwtDate::Week0Type week0Type() const;
56
57 void setMaxWeeks( int );
58 int maxWeeks() const;
59
60 virtual void autoScale(
61 int maxNumSteps, double& x1, double& x2,
62 double& stepSize ) const QWT_OVERRIDE;
63
64 virtual QwtScaleDiv divideScale(
65 double x1, double x2,
66 int maxMajorSteps, int maxMinorSteps,
67 double stepSize = 0.0 ) const QWT_OVERRIDE;
68
69 virtual QwtDate::IntervalType intervalType(
70 const QDateTime&, const QDateTime&, int maxSteps ) const;
71
72 QDateTime toDateTime( double ) const;
73
74 protected:
75 virtual QDateTime alignDate( const QDateTime&, double stepSize,
76 QwtDate::IntervalType, bool up ) const;
77
78 private:
79 QwtScaleDiv buildScaleDiv( const QDateTime&, const QDateTime&,
80 int maxMajorSteps, int maxMinorSteps,
81 QwtDate::IntervalType ) const;
82
83 private:
84 class PrivateData;
85 PrivateData* m_data;
86};
87
88#endif
QwtDate::Week0Type
Week0Type
Definition qwt_date.h:50
QwtDate::IntervalType
IntervalType
Definition qwt_date.h:76
QwtDateScaleEngine
A scale engine for date/time values.
Definition qwt_date_scale_engine.h:43
QwtLinearScaleEngine
A scale engine for linear scales.
Definition qwt_scale_engine.h:152
QwtLinearScaleEngine::autoScale
virtual void autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const override
Definition qwt_scale_engine.cpp:531
QwtLinearScaleEngine::divideScale
virtual QwtScaleDiv divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const override
Calculate a scale division for an interval.
Definition qwt_scale_engine.cpp:577
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34