Struct cxx_qt_lib::QDate

source ·
#[repr(C)]
pub struct QDate { /* private fields */ }
Expand description

The QDate class provides date functions.

Implementations§

source§

impl QDate

source

pub fn add_months(&self, nmonths: i32) -> QDate

Returns a QDate object containing a date nmonths later than the date of this object (or earlier if nmonths is negative).

source§

impl QDate

source

pub fn add_years(&self, nyears: i32) -> QDate

Returns a QDate object containing a date nyears later than the date of this object (or earlier if nyears is negative).

source§

impl QDate

source

pub fn day(&self) -> i32

Returns the day of the month for this date.

source§

impl QDate

source

pub fn day_of_week(&self) -> i32

Returns the weekday (1 = Monday to 7 = Sunday) for this date.

source§

impl QDate

source

pub fn day_of_year(&self) -> i32

Returns the day of the year (1 for the first day) for this date.

source§

impl QDate

source

pub fn days_in_monyth(&self) -> i32

Returns the number of days in the month for this date.

source§

impl QDate

source

pub fn days_in_year(&self) -> i32

Returns the number of days in the year for this date.

source§

impl QDate

source

pub fn is_null(&self) -> bool

Returns true if the date is null; otherwise returns false. A null date is invalid.

source§

impl QDate

source

pub fn is_valid(&self) -> bool

Returns true if this date is valid; otherwise returns false.

source§

impl QDate

source

pub fn month(&self) -> i32

Returns the month-number for the date.

Numbers the months of the year starting with 1 for the first

source§

impl QDate

source

pub fn set_date(&mut self, y: i32, m: i32, d: i32) -> bool

Sets this to represent the date, in the Gregorian calendar, with the given year, month and day numbers. Returns true if the resulting date is valid, otherwise it sets this to represent an invalid date and returns false.

source§

impl QDate

source

pub fn format_enum(&self, format: DateFormat) -> QString

Returns the time as a string. The format parameter determines the format of the string.

source§

impl QDate

source

pub fn year(&self) -> i32

Returns the year of this date.

source§

impl QDate

source

pub fn add_days(&self, ndays: i64) -> Self

Returns a QDate object containing a date ndays later than the date of this object (or earlier if ndays is negative).

Returns a null date if the current date is invalid or the new date is out of range.

source

pub fn current_date() -> Self

source

pub fn days_to(&self, date: Self) -> i64

Returns the number of days from this date to d (which is negative if d is earlier than this date).

Returns 0 if either date is invalid.

source

pub fn format(&self, format: &QString) -> QString

Returns the time as a string. The format parameter determines the format of the result string.

source

pub fn from_julian_day(jd: i64) -> Self

Converts the Julian day jd to a QDate.

source

pub fn from_string(string: &QString, format: &QString) -> Option<Self>

Returns the QTime represented by the string, using the format given, or None if the string cannot be parsed.

source

pub fn from_string_enum(string: &QString, format: DateFormat) -> Option<Self>

Returns the time represented in the string as a QTime using the format given, or None if this is not possible.

source

pub fn is_leap_year(year: i32) -> bool

Returns true if the specified year is a leap year in the Gregorian calendar; otherwise returns false.

source

pub fn new(y: i32, m: i32, d: i32) -> Self

Constructs a date with year y, month m and day d.

source

pub fn to_julian_day(&self) -> i64

Converts the date to a Julian day.

Trait Implementations§

source§

impl Clone for QDate

source§

fn clone(&self) -> QDate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QDate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for QDate

source§

fn default() -> Self

Constructs a null date. Null dates are invalid.

source§

impl Display for QDate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ExternType for QDate

§

type Id = (Q, D, a, t, e)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Trivial

source§

impl Ord for QDate

source§

fn cmp(&self, other: &QDate) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for QDate

source§

fn eq(&self, other: &QDate) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for QDate

source§

fn partial_cmp(&self, other: &QDate) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl QListElement for QDate

§

type TypeId = (Q, L, i, s, t, __, Q, D, a, t, e)

source§

fn append(list: &mut QList<Self>, value: Self)

source§

fn append_clone(list: &mut QList<Self>, value: &Self)

source§

fn clear(list: &mut QList<Self>)

source§

fn clone(list: &QList<Self>) -> QList<Self>

source§

fn contains(list: &QList<Self>, value: &Self) -> bool

source§

fn default() -> QList<Self>

source§

fn drop(list: &mut QList<Self>)

source§

unsafe fn get_unchecked(list: &QList<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(list: &QList<Self>, value: &Self) -> isize

source§

fn insert(list: &mut QList<Self>, pos: isize, value: Self)

source§

fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)

source§

fn len(list: &QList<Self>) -> isize

source§

fn remove(list: &mut QList<Self>, pos: isize)

source§

fn reserve(list: &mut QList<Self>, size: isize)

source§

impl QSetElement for QDate

§

type TypeId = (Q, S, e, t, __, Q, D, a, t, e)

source§

fn clear(set: &mut QSet<Self>)

source§

fn clone(set: &QSet<Self>) -> QSet<Self>

source§

fn contains(set: &QSet<Self>, value: &Self) -> bool

source§

fn default() -> QSet<Self>

source§

fn drop(set: &mut QSet<Self>)

source§

unsafe fn get_unchecked(set: &QSet<Self>, pos: isize) -> &Self

Safety Read more
source§

fn insert(set: &mut QSet<Self>, value: Self)

source§

fn insert_clone(set: &mut QSet<Self>, value: &Self)

source§

fn len(set: &QSet<Self>) -> isize

source§

fn remove(set: &mut QSet<Self>, value: &Self) -> bool

source§

impl QVariantValue for QDate

source§

impl QVectorElement for QDate

§

type TypeId = (Q, V, e, c, t, o, r, __, Q, D, a, t, e)

source§

fn append(vector: &mut QVector<Self>, value: Self)

source§

fn append_clone(vector: &mut QVector<Self>, value: &Self)

source§

fn clear(vector: &mut QVector<Self>)

source§

fn clone(vector: &QVector<Self>) -> QVector<Self>

source§

fn contains(vector: &QVector<Self>, value: &Self) -> bool

source§

fn default() -> QVector<Self>

source§

fn drop(vector: &mut QVector<Self>)

source§

unsafe fn get_unchecked(vector: &QVector<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(vector: &QVector<Self>, value: &Self) -> isize

source§

fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)

source§

fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)

source§

fn len(vector: &QVector<Self>) -> isize

source§

fn remove(vector: &mut QVector<Self>, pos: isize)

source§

fn reserve(vector: &mut QVector<Self>, size: isize)

source§

impl Eq for QDate

source§

impl StructuralPartialEq for QDate

Auto Trait Implementations§

§

impl Freeze for QDate

§

impl RefUnwindSafe for QDate

§

impl Send for QDate

§

impl Sync for QDate

§

impl Unpin for QDate

§

impl UnwindSafe for QDate

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.