QWT 7.0.1
Loading...
Searching...
No Matches
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
59class QWT_EXPORT QwtDate
60{
61 public:
67 {
76
83 FirstDay
84 };
85
93 {
96
99
102
105
108
111
114
116 Year
117 };
118
119 enum
120 {
122 JulianDayForEpoch = 2440588
123 };
124
125 static QDate minDate();
126 static QDate maxDate();
127
128 static QDateTime toDateTime( double value,
129 Qt::TimeSpec = Qt::UTC );
130
131 static double toDouble( const QDateTime& );
132
133 static QDateTime ceil( const QDateTime&, IntervalType );
134 static QDateTime floor( const QDateTime&, IntervalType );
135
136 static QDate dateOfWeek0( int year, Week0Type );
137 static int weekNumber( const QDate&, Week0Type );
138
139 static int utcOffset( const QDateTime& );
140
141 static QString toString( const QDateTime&,
142 const QString& format, Week0Type );
143};
144
145#endif
A collection of methods around date/time values.
Definition qwt_date.h:60
Week0Type
How to identify the first week of year differs between countries.
Definition qwt_date.h:67
@ FirstThursday
According to ISO 8601 the first week of a year is defined as "the week with the year's first Thursday...
Definition qwt_date.h:75
IntervalType
Classification of an time interval.
Definition qwt_date.h:93
@ Month
The interval is related to months.
Definition qwt_date.h:113
@ Day
The interval is related to days.
Definition qwt_date.h:107
@ Millisecond
The interval is related to milliseconds.
Definition qwt_date.h:95
@ Minute
The interval is related to minutes.
Definition qwt_date.h:101
@ Hour
The interval is related to hours.
Definition qwt_date.h:104
@ Second
The interval is related to seconds.
Definition qwt_date.h:98
@ Week
The interval is related to weeks.
Definition qwt_date.h:110