Dhanya Thattil 38cd10d4e6
Qt5 built in qwt (#570)
- qt4->qt5
- in built qt5 6.1.5 because rhel7 is not upto date with qt5, removed findqwt.cmake
- made a fix in qwt lib (qwt_plot_layout.h) to work with 5.15 and lower versions for qrect constr.
- qt5 forms fixed, qt4 many hard coding forms switched to forms including qtabwidget, scrolls etc, fonts moved to forms
 - docking option enabled by default, removed option to disable docking feature from "Mode"
- added qVersionResolve utility functions to handle compatibility before and after qt5.12
- qtplots (ian's code) takes in gain mode enable to set some settings within the class, with proper gain plot ticks
- ensure gain plots have no zooming of z axis in 2d and y axis in 1d
- removed placeholder text in qpalette in main window form as its not supportd until 5.12 (so using qt5.9 designer insted of qt5.15 to cope)
- tab order
Servers:
- fixed some error messages that were empty for fail in funcs (mostly minor as if this error, major issues)
2022-11-11 15:15:10 +01:00

129 lines
3.4 KiB
C++

/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef _QWT_DATE_H_
#define _QWT_DATE_H_
#include "qwt_global.h"
#include <qdatetime.h>
/*!
\brief A collection of methods around date/time values
Qt offers convenient classes for dealing with date/time values,
but Qwt uses coordinate systems that are based on doubles.
QwtDate offers methods to translate from QDateTime to double and v.v.
A double is interpreted as the number of milliseconds since
1970-01-01T00:00:00 Universal Coordinated Time - also known
as "The Epoch".
While the range of the Julian day in Qt4 is limited to [0, MAX_INT],
Qt5 stores it as qint64 offering a huge range of valid dates.
As the significance of a double is below this ( assuming a
fraction of 52 bits ) the translation is not
bijective with rounding errors for dates very far from Epoch.
For a resolution of 1 ms those start to happen for dates above the
year 144683.
An axis for a date/time interval is expected to be aligned
and divided in time/date units like seconds, minutes, ...
QwtDate offers several algorithms that are needed to
calculate these axes.
\sa QwtDateScaleEngine, QwtDateScaleDraw, QDate, QTime
*/
class QWT_EXPORT QwtDate
{
public:
/*!
How to identify the first week of year differs between
countries.
*/
enum Week0Type
{
/*!
According to ISO 8601 the first week of a year is defined
as "the week with the year's first Thursday in it".
FirstThursday corresponds to the numbering that is
implemented in QDate::weekNumber().
*/
FirstThursday,
/*!
"The week with January 1.1 in it."
In the U.S. this definition is more common than
FirstThursday.
*/
FirstDay
};
/*!
Classification of an time interval
Time intervals needs to be classified to decide how to
align and divide it.
*/
enum IntervalType
{
//! The interval is related to milliseconds
Millisecond,
//! The interval is related to seconds
Second,
//! The interval is related to minutes
Minute,
//! The interval is related to hours
Hour,
//! The interval is related to days
Day,
//! The interval is related to weeks
Week,
//! The interval is related to months
Month,
//! The interval is related to years
Year
};
enum
{
//! The Julian day of "The Epoch"
JulianDayForEpoch = 2440588
};
static QDate minDate();
static QDate maxDate();
static QDateTime toDateTime( double value,
Qt::TimeSpec = Qt::UTC );
static double toDouble( const QDateTime & );
static QDateTime ceil( const QDateTime &, IntervalType );
static QDateTime floor( const QDateTime &, IntervalType );
static QDate dateOfWeek0( int year, Week0Type );
static int weekNumber( const QDate &, Week0Type );
static int utcOffset( const QDateTime & );
static QString toString( const QDateTime &,
const QString & format, Week0Type );
};
#endif