QWT API (中文) 7.0.1
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
75{
76 public:
78 explicit QwtDateScaleEngine( Qt::TimeSpec = Qt::LocalTime );
79
81 virtual ~QwtDateScaleEngine();
82
84 void setTimeSpec( Qt::TimeSpec );
85
87 Qt::TimeSpec timeSpec() const;
88
90 void setUtcOffset( int seconds );
91
93 int utcOffset() const;
94
96 void setWeek0Type( QwtDate::Week0Type );
97
99 QwtDate::Week0Type week0Type() const;
100
102 void setMaxWeeks( int );
103
105 int maxWeeks() const;
106
108 virtual void autoScale(
109 int maxNumSteps, double& x1, double& x2,
110 double& stepSize ) const override;
111
113 virtual QwtScaleDiv divideScale(
114 double x1, double x2,
115 int maxMajorSteps, int maxMinorSteps,
116 double stepSize = 0.0 ) const override;
117
119 virtual QwtDate::IntervalType intervalType(
120 const QDateTime&, const QDateTime&, int maxSteps ) const;
121
123 QDateTime toDateTime( double ) const;
124
125 protected:
126 virtual QDateTime alignDate( const QDateTime&, double stepSize,
127 QwtDate::IntervalType, bool up ) const;
128
129 private:
130 QwtScaleDiv buildScaleDiv( const QDateTime&, const QDateTime&,
131 int maxMajorSteps, int maxMinorSteps,
132 QwtDate::IntervalType ) const;
133
134 private:
135 class PrivateData;
136 PrivateData* m_data;
137};
138
139#endif
用于日期/时间值的刻度引擎
Definition qwt_date_scale_engine.h:75
Week0Type
如何确定一年的第一周(不同国家标准不同)
Definition qwt_date.h:91
IntervalType
时间间隔的分类
Definition qwt_date.h:133
线性刻度引擎
Definition qwt_scale_engine.h:191
virtual void autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const override
对齐并划分区间
Definition qwt_scale_engine.cpp:675
virtual QwtScaleDiv divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const override
计算区间的刻度划分
Definition qwt_scale_engine.cpp:726
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53