QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_DATE_SCALE_ENGINE_H
28#define QWT_DATE_SCALE_ENGINE_H
29
30#include "qwt_global.h"
31#include "qwt_date.h"
32#include "qwt_scale_engine.h"
33
58{
59public:
61 explicit QwtDateScaleEngine(Qt::TimeSpec = Qt::LocalTime);
62
64 ~QwtDateScaleEngine() override;
65
67 void setTimeSpec(Qt::TimeSpec);
68
70 Qt::TimeSpec timeSpec() const;
71
73 void setUtcOffset(int seconds);
74
76 int utcOffset() const;
77
79 void setWeek0Type(QwtDate::Week0Type);
80
82 QwtDate::Week0Type week0Type() const;
83
85 void setMaxWeeks(int);
86
88 int maxWeeks() const;
89
91 virtual void autoScale(int maxNumSteps, double& x1, double& x2, double& stepSize) const override;
92
94 virtual QwtScaleDiv
95 divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize = 0.0) const override;
96
98 virtual QwtDate::IntervalType intervalType(const QDateTime&, const QDateTime&, int maxSteps) const;
99
101 QDateTime toDateTime(double) const;
102
103protected:
104 virtual QDateTime alignDate(const QDateTime&, double stepSize, QwtDate::IntervalType, bool up) const;
105
106private:
108 buildScaleDiv(const QDateTime&, const QDateTime&, int maxMajorSteps, int maxMinorSteps, QwtDate::IntervalType) const;
109
110private:
111 QWT_DECLARE_PRIVATE(QwtDateScaleEngine)
112};
113
114#endif
A scale engine for date/time values
Definition qwt_date_scale_engine.h:58
Week0Type
How to identify the first week of year differs between countries
Definition qwt_date.h:68
IntervalType
Classification of a time interval
Definition qwt_date.h:91
A scale engine for linear scales
Definition qwt_scale_engine.h:160
virtual void autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const override
Align and divide an interval
Definition qwt_scale_engine.cpp:493
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:533
A class representing a scale division
Definition qwt_scale_div.h:47