|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Convenience class for time computations. More...
#include <Timespan.h>
Public Member Functions | |
| Q_INVOKABLE bool | isFinite () const |
| Checks if the time is valid. | |
| Q_INVOKABLE bool | isNegative () const |
| Checks if the time is negative. | |
| Q_INVOKABLE Units::Timespan & | operator+= (Units::Timespan other) |
| Add time to this time. | |
| Q_INVOKABLE std::partial_ordering | operator<=> (const Units::Timespan &rhs) const =default |
| Comparison. | |
| Q_INVOKABLE double | toS () const |
| Convert time to seconds. | |
| Q_INVOKABLE double | toM () const |
| Convert time to minutes. | |
| Q_INVOKABLE double | toH () const |
| Convert time to hours. | |
| Q_INVOKABLE QString | toHoursAndMinutes () const |
| Convert time to string. | |
Static Public Member Functions | |
| static auto | fromH (double timeInH) -> Timespan |
| Constructs a time. | |
| static Timespan | fromMS (double timeInMS) |
| Constructs a time. | |
| static auto | fromS (double timeInS) -> Timespan |
| Constructs a time. | |
Convenience class for time computations.
This extremely simple class allows computation with times, without the need to worry about units.
Definition at line 35 of file Timespan.h.
|
inlinestatic |
Constructs a time.
| timeInH | time in hours |
Definition at line 46 of file Timespan.h.
|
inlinestatic |
Constructs a time.
| timeInMS | time in milliseconds |
Definition at line 58 of file Timespan.h.
|
inlinestatic |
Constructs a time.
| timeInS | time in seconds |
Definition at line 71 of file Timespan.h.
|
inlinenodiscard |
Checks if the time is valid.
Definition at line 81 of file Timespan.h.
|
inlinenodiscard |
Checks if the time is negative.
Definition at line 90 of file Timespan.h.
|
inline |
Add time to this time.
| other | time to be added |
Definition at line 101 of file Timespan.h.
|
nodiscarddefault |
Comparison.
| rhs | Right hand side of the comparison |
|
inlinenodiscard |
|
nodiscard |
Convert time to string.
|
inlinenodiscard |
|
inlinenodiscard |