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
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
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,
82
83 private:
84 class PrivateData;
85 PrivateData* m_data;
86};
87
88#endif
IntervalType
Definition qwt_date.h:76
A scale engine for date/time values.
A scale engine for linear scales.
virtual void autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const override
virtual QwtScaleDiv divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const override
Calculate a scale division for an interval.
A class representing a scale division.