QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
Contains utility methods for working with temporal layers and projects. More...
#include <qgstemporalutils.h>
Public Member Functions | |
QDateTime | addToDateTime (const QDateTime &dateTime) |
Adds this duration to a starting dateTime value. | |
bool | isNull () const |
Returns true if the duration is null, i.e. | |
bool | operator!= (const QgsTimeDuration &other) const |
bool | operator== (const QgsTimeDuration &other) const |
QgsInterval | toInterval () const |
Converts the duration to an interval value. | |
long long | toSeconds () const |
Returns the total duration in seconds. | |
QString | toString () const |
Converts the duration to an ISO8601 duration string. | |
Static Public Member Functions | |
static QgsTimeDuration | fromString (const QString &string, bool &ok) |
Creates a QgsTimeDuration from a string value. | |
Public Attributes | |
int | days = 0 |
Days. | |
int | hours = 0 |
Hours. | |
int | minutes = 0 |
Minutes. | |
int | months = 0 |
Months. | |
double | seconds = 0 |
Seconds. | |
int | weeks = 0 |
Weeks. | |
int | years = 0 |
Years. | |
Contains utility methods for working with temporal layers and projects.
Designed for storage of ISO8601 duration values.
Definition at line 40 of file qgstemporalutils.h.
QDateTime QgsTimeDuration::addToDateTime | ( | const QDateTime & | dateTime | ) |
Adds this duration to a starting dateTime value.
Definition at line 347 of file qgstemporalutils.cpp.
|
static |
Creates a QgsTimeDuration from a string value.
Definition at line 363 of file qgstemporalutils.cpp.
|
inline |
Returns true
if the duration is null, i.e.
an empty duration.
Definition at line 62 of file qgstemporalutils.h.
|
inline |
Definition at line 76 of file qgstemporalutils.h.
|
inline |
Definition at line 69 of file qgstemporalutils.h.
QgsInterval QgsTimeDuration::toInterval | ( | ) | const |
Converts the duration to an interval value.
Definition at line 278 of file qgstemporalutils.cpp.
long long QgsTimeDuration::toSeconds | ( | ) | const |
Returns the total duration in seconds.
Definition at line 327 of file qgstemporalutils.cpp.
QString QgsTimeDuration::toString | ( | ) | const |
Converts the duration to an ISO8601 duration string.
Definition at line 283 of file qgstemporalutils.cpp.
int QgsTimeDuration::days = 0 |
Days.
Definition at line 51 of file qgstemporalutils.h.
int QgsTimeDuration::hours = 0 |
Hours.
Definition at line 53 of file qgstemporalutils.h.
int QgsTimeDuration::minutes = 0 |
Minutes.
Definition at line 55 of file qgstemporalutils.h.
int QgsTimeDuration::months = 0 |
Months.
Definition at line 47 of file qgstemporalutils.h.
double QgsTimeDuration::seconds = 0 |
Seconds.
Definition at line 57 of file qgstemporalutils.h.
int QgsTimeDuration::weeks = 0 |
Weeks.
Definition at line 49 of file qgstemporalutils.h.
int QgsTimeDuration::years = 0 |
Years.
Definition at line 45 of file qgstemporalutils.h.