QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
|
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. More... | |
bool | isNull () const |
Returns true if the duration is null, i.e. More... | |
bool | operator!= (const QgsTimeDuration &other) const |
bool | operator== (const QgsTimeDuration &other) const |
QgsInterval | toInterval () const |
Converts the duration to an interval value. More... | |
long long | toSeconds () const |
Returns the total duration in seconds. More... | |
QString | toString () const |
Converts the duration to an ISO8601 duration string. More... | |
Static Public Member Functions | |
static QgsTimeDuration | fromString (const QString &string, bool &ok) |
Creates a QgsTimeDuration from a string value. More... | |
Public Attributes | |
int | days = 0 |
Days. More... | |
int | hours = 0 |
Hours. More... | |
int | minutes = 0 |
Minutes. More... | |
int | months = 0 |
Months. More... | |
double | seconds = 0 |
Seconds. More... | |
int | weeks = 0 |
Weeks. More... | |
int | years = 0 |
Years. More... | |
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.