QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_date.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_H
28#define QWT_DATE_H
29
30#include "qwt_global.h"
31#include <qdatetime.h>
32
79class QWT_EXPORT QwtDate
80{
81public:
91 {
105
116 FirstDay
117 };
118
133 {
136
139
142
145
148
151
154
156 Year
157 };
158
159 enum
160 {
162 JulianDayForEpoch = 2440588
163 };
164
165 // Get minimum date
166 static QDate minDate();
167 // Get maximum date
168 static QDate maxDate();
169
170 // Convert double to QDateTime
171 static QDateTime toDateTime(double value, Qt::TimeSpec = Qt::UTC);
172
173 // Convert QDateTime to double
174 static double toDouble(const QDateTime&);
175
176 // Ceil datetime to interval type
177 static QDateTime ceil(const QDateTime&, IntervalType);
178 // Floor datetime to interval type
179 static QDateTime floor(const QDateTime&, IntervalType);
180
181 // Get date of week 0
182 static QDate dateOfWeek0(int year, Week0Type);
183 // Get week number
184 static int weekNumber(const QDate&, Week0Type);
185
186 // Get UTC offset in seconds
187 static int utcOffset(const QDateTime&);
188
189 // Format datetime to string
190 static QString toString(const QDateTime&, const QString& format, Week0Type);
191};
192
193#endif
日期/时间值相关方法的集合
Definition qwt_date.h:80
Week0Type
如何确定一年的第一周(不同国家标准不同)
Definition qwt_date.h:91
@ FirstThursday
Definition qwt_date.h:104
IntervalType
时间间隔的分类
Definition qwt_date.h:133
@ Month
Definition qwt_date.h:153
@ Day
Definition qwt_date.h:147
@ Millisecond
毫秒
Definition qwt_date.h:135
@ Minute
分钟
Definition qwt_date.h:141
@ Hour
小时
Definition qwt_date.h:144
@ Second
Definition qwt_date.h:138
@ Week
Definition qwt_date.h:150