-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtimespan.h
67 lines (49 loc) · 1.54 KB
/
qtimespan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef QTIMESPAN_H
#define QTIMESPAN_H
#include <QtCore/qstring.h>
#include <QtCore/qnamespace.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Core)
class Q_CORE_EXPORT QTimeSpan
{
public:
QTimeSpan();
~QTimeSpan();
static QTimeSpan fromMilliseconds( qint64 milliseconds );
static QTimeSpan fromSeconds( double seconds );
static QTimeSpan fromMinutes( double minutes );
static QTimeSpan fromHours( double hours );
static QTimeSpan fromDays( double days );
qint32 milliseconds() const;
qint32 seconds() const;
qint32 minutes() const;
qint32 hours() const;
qint32 days() const;
/* qint32 months();
qint32 years();*/
double totalMilliseconds() const;
double totalSeconds() const;
double totalMinutes() const;
double totalHours() const;
double totalDays() const;
/* double totalWeeks();
double totalMonths();
double totalYears();*/
bool operator==( const QTimeSpan& rhs) const;
bool operator!=( const QTimeSpan& rhs) const;
bool operator>=( const QTimeSpan& rhs) const;
bool operator>( const QTimeSpan& rhs) const;
bool operator<=( const QTimeSpan& rhs) const;
bool operator<( const QTimeSpan& rhs) const;
QTimeSpan& operator=( const QTimeSpan& rhs );
QTimeSpan& operator+=( const QTimeSpan rhs );
QTimeSpan& operator-=( const QTimeSpan rhs );
const QTimeSpan operator+( const QTimeSpan rhs ) const;
const QTimeSpan operator-( const QTimeSpan rhs ) const;
private:
qint64 ms;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QTIMESPAN_H