mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Sipify core.QgsInterval
This commit is contained in:
parent
716fe52498
commit
d56eef1f4e
@ -15,7 +15,6 @@ core/qgsgeometryvalidator.sip
|
|||||||
core/qgsgml.sip
|
core/qgsgml.sip
|
||||||
core/qgsgmlschema.sip
|
core/qgsgmlschema.sip
|
||||||
core/qgshistogram.sip
|
core/qgshistogram.sip
|
||||||
core/qgsinterval.sip
|
|
||||||
core/qgsjsonutils.sip
|
core/qgsjsonutils.sip
|
||||||
core/qgsmaptopixelgeometrysimplifier.sip
|
core/qgsmaptopixelgeometrysimplifier.sip
|
||||||
core/qgstransaction.sip
|
core/qgstransaction.sip
|
||||||
|
@ -1,139 +1,203 @@
|
|||||||
/** \ingroup core
|
/************************************************************************
|
||||||
* \class QgsInterval
|
* This file has been generated automatically from *
|
||||||
* \brief A representation of the interval between two datetime values.
|
* *
|
||||||
* \note Added in version 2.16
|
* src/core/qgsinterval.h *
|
||||||
*/
|
* *
|
||||||
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class QgsInterval
|
class QgsInterval
|
||||||
{
|
{
|
||||||
%TypeHeaderCode
|
%Docstring
|
||||||
#include <qgsinterval.h>
|
A representation of the interval between two datetime values.
|
||||||
|
.. versionadded:: 2.16
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include "qgsinterval.h"
|
||||||
|
%End
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// YEAR const value taken from postgres query
|
|
||||||
// SELECT EXTRACT(EPOCH FROM interval '1 year')
|
|
||||||
//! Seconds per year (average)
|
|
||||||
static const int YEARS;
|
static const int YEARS;
|
||||||
//! Seconds per month, based on 30 day month
|
%Docstring
|
||||||
|
Seconds per year (average)
|
||||||
|
%End
|
||||||
static const int MONTHS;
|
static const int MONTHS;
|
||||||
//! Seconds per week
|
%Docstring
|
||||||
|
Seconds per month, based on 30 day month
|
||||||
|
%End
|
||||||
static const int WEEKS;
|
static const int WEEKS;
|
||||||
//! Seconds per day
|
%Docstring
|
||||||
|
Seconds per week
|
||||||
|
%End
|
||||||
static const int DAY;
|
static const int DAY;
|
||||||
//! Seconds per hour
|
%Docstring
|
||||||
|
Seconds per day
|
||||||
|
%End
|
||||||
static const int HOUR;
|
static const int HOUR;
|
||||||
//! Seconds per minute
|
%Docstring
|
||||||
|
Seconds per hour
|
||||||
|
%End
|
||||||
static const int MINUTE;
|
static const int MINUTE;
|
||||||
|
%Docstring
|
||||||
|
Seconds per minute
|
||||||
|
%End
|
||||||
|
|
||||||
/** Default constructor for QgsInterval. Creates an invalid interval.
|
|
||||||
*/
|
|
||||||
QgsInterval();
|
QgsInterval();
|
||||||
|
%Docstring
|
||||||
|
Default constructor for QgsInterval. Creates an invalid interval.
|
||||||
|
%End
|
||||||
|
|
||||||
/** Constructor for QgsInterval.
|
|
||||||
* @param seconds duration of interval in seconds
|
|
||||||
*/
|
|
||||||
QgsInterval( double seconds );
|
QgsInterval( double seconds );
|
||||||
|
%Docstring
|
||||||
|
Constructor for QgsInterval.
|
||||||
|
\param seconds duration of interval in seconds
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in years (based on an average year length)
|
|
||||||
* @see setYears()
|
|
||||||
*/
|
|
||||||
double years() const;
|
double years() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in years (based on an average year length)
|
||||||
|
.. seealso:: setYears()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in years.
|
|
||||||
* @param years duration in years (based on average year length)
|
|
||||||
* @see years()
|
|
||||||
*/
|
|
||||||
void setYears( double years );
|
void setYears( double years );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in years.
|
||||||
|
\param years duration in years (based on average year length)
|
||||||
|
.. seealso:: years()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in months (based on a 30 day month).
|
|
||||||
* @see setMonths()
|
|
||||||
*/
|
|
||||||
double months() const;
|
double months() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in months (based on a 30 day month).
|
||||||
|
.. seealso:: setMonths()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in months.
|
|
||||||
* @param months duration in months (based on a 30 day month)
|
|
||||||
* @see months()
|
|
||||||
*/
|
|
||||||
void setMonths( double months );
|
void setMonths( double months );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in months.
|
||||||
|
\param months duration in months (based on a 30 day month)
|
||||||
|
.. seealso:: months()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in weeks.
|
|
||||||
* @see setWeeks()
|
|
||||||
*/
|
|
||||||
double weeks() const;
|
double weeks() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in weeks.
|
||||||
|
.. seealso:: setWeeks()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in weeks.
|
|
||||||
* @param weeks duration in weeks
|
|
||||||
* @see weeks()
|
|
||||||
*/
|
|
||||||
void setWeeks( double weeks );
|
void setWeeks( double weeks );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in weeks.
|
||||||
|
\param weeks duration in weeks
|
||||||
|
.. seealso:: weeks()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in days.
|
|
||||||
* @see setDays()
|
|
||||||
*/
|
|
||||||
double days() const;
|
double days() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in days.
|
||||||
|
.. seealso:: setDays()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in days.
|
|
||||||
* @param days duration in days
|
|
||||||
* @see days()
|
|
||||||
*/
|
|
||||||
void setDays( double days );
|
void setDays( double days );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in days.
|
||||||
|
\param days duration in days
|
||||||
|
.. seealso:: days()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in hours.
|
|
||||||
* @see setHours()
|
|
||||||
*/
|
|
||||||
double hours() const;
|
double hours() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in hours.
|
||||||
|
.. seealso:: setHours()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in hours.
|
|
||||||
* @param hours duration in hours
|
|
||||||
* @see hours()
|
|
||||||
*/
|
|
||||||
void setHours( double hours );
|
void setHours( double hours );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in hours.
|
||||||
|
\param hours duration in hours
|
||||||
|
.. seealso:: hours()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in minutes.
|
|
||||||
* @see setMinutes()
|
|
||||||
*/
|
|
||||||
double minutes() const;
|
double minutes() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in minutes.
|
||||||
|
.. seealso:: setMinutes()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in minutes.
|
|
||||||
* @param minutes duration in minutes
|
|
||||||
* @see minutes()
|
|
||||||
*/
|
|
||||||
void setMinutes( double minutes );
|
void setMinutes( double minutes );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in minutes.
|
||||||
|
\param minutes duration in minutes
|
||||||
|
.. seealso:: minutes()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns the interval duration in seconds.
|
|
||||||
* @see setSeconds()
|
|
||||||
*/
|
|
||||||
double seconds() const;
|
double seconds() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the interval duration in seconds.
|
||||||
|
.. seealso:: setSeconds()
|
||||||
|
:rtype: float
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets the interval duration in seconds.
|
|
||||||
* @param seconds duration in seconds
|
|
||||||
* @see seconds()
|
|
||||||
*/
|
|
||||||
void setSeconds( double seconds );
|
void setSeconds( double seconds );
|
||||||
|
%Docstring
|
||||||
|
Sets the interval duration in seconds.
|
||||||
|
\param seconds duration in seconds
|
||||||
|
.. seealso:: seconds()
|
||||||
|
%End
|
||||||
|
|
||||||
/** Returns true if the interval is valid.
|
|
||||||
* @see setValid()
|
|
||||||
*/
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
%Docstring
|
||||||
|
Returns true if the interval is valid.
|
||||||
|
.. seealso:: setValid()
|
||||||
|
:rtype: bool
|
||||||
|
%End
|
||||||
|
|
||||||
/** Sets whether the interval is valid.
|
|
||||||
* @param valid set to true to set the interval as valid.
|
|
||||||
* @see isValid()
|
|
||||||
*/
|
|
||||||
void setValid( bool valid );
|
void setValid( bool valid );
|
||||||
|
%Docstring
|
||||||
|
Sets whether the interval is valid.
|
||||||
|
\param valid set to true to set the interval as valid.
|
||||||
|
.. seealso:: isValid()
|
||||||
|
%End
|
||||||
|
|
||||||
bool operator==( QgsInterval other ) const;
|
bool operator==( QgsInterval other ) const;
|
||||||
|
%Docstring
|
||||||
|
:rtype: bool
|
||||||
|
%End
|
||||||
|
|
||||||
/** Converts a string to an interval
|
|
||||||
* @param string string to parse
|
|
||||||
* @returns interval, or invalid interval if string could not be parsed
|
|
||||||
*/
|
|
||||||
static QgsInterval fromString( const QString &string );
|
static QgsInterval fromString( const QString &string );
|
||||||
|
%Docstring
|
||||||
|
Converts a string to an interval
|
||||||
|
\param string string to parse
|
||||||
|
:return: interval, or invalid interval if string could not be parsed
|
||||||
|
:rtype: QgsInterval
|
||||||
|
%End
|
||||||
|
|
||||||
//! Allows direct construction of QVariants from intervals.
|
|
||||||
operator QVariant() const;
|
operator QVariant() const;
|
||||||
|
%Docstring
|
||||||
|
Allows direct construction of QVariants from intervals.
|
||||||
|
%End
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************
|
||||||
|
* This file has been generated automatically from *
|
||||||
|
* *
|
||||||
|
* src/core/qgsinterval.h *
|
||||||
|
* *
|
||||||
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||||
|
************************************************************************/
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include "qgis.h"
|
||||||
#include "qgis_core.h"
|
#include "qgis_core.h"
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
@ -175,6 +176,8 @@ class CORE_EXPORT QgsInterval
|
|||||||
|
|
||||||
Q_DECLARE_METATYPE( QgsInterval )
|
Q_DECLARE_METATYPE( QgsInterval )
|
||||||
|
|
||||||
|
#ifndef SIP_RUN
|
||||||
|
|
||||||
/** Returns the interval between two datetimes.
|
/** Returns the interval between two datetimes.
|
||||||
* \param datetime1 start datetime
|
* \param datetime1 start datetime
|
||||||
* \param datetime2 datetime to subtract, ie subtract datetime2 from datetime1
|
* \param datetime2 datetime to subtract, ie subtract datetime2 from datetime1
|
||||||
@ -210,4 +213,6 @@ QDateTime CORE_EXPORT operator+( const QDateTime &start, const QgsInterval &inte
|
|||||||
//! Debug string representation of interval
|
//! Debug string representation of interval
|
||||||
QDebug operator<<( QDebug dbg, const QgsInterval &interval );
|
QDebug operator<<( QDebug dbg, const QgsInterval &interval );
|
||||||
\
|
\
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // QGSINTERVAL_H
|
#endif // QGSINTERVAL_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user