pub struct QTime { /* private fields */ }
Expand description
The QTime class provides clock time functions.
Implementations§
Source§impl QTime
impl QTime
Sourcepub fn add_msecs(&self, ms: i32) -> QTime
pub fn add_msecs(&self, ms: i32) -> QTime
Returns a QTime object containing a time ms milliseconds later than the time of this object (or earlier if ms is negative).
Sourcepub fn add_secs(&self, s: i32) -> QTime
pub fn add_secs(&self, s: i32) -> QTime
Returns a QTime object containing a time s seconds later than the time of this object (or earlier if s is negative).
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if the time is null (i.e., the QTime object was constructed using the default constructor); otherwise returns false. A null time is also an invalid time.
Sourcepub fn msecs_since_start_of_day(&self) -> i32
pub fn msecs_since_start_of_day(&self) -> i32
Returns the number of msecs since the start of the day, i.e. since 00:00:00.
Sourcepub fn set_hms(&mut self, h: i32, m: i32, s: i32, ms: i32) -> bool
pub fn set_hms(&mut self, h: i32, m: i32, s: i32, ms: i32) -> bool
Sets the time to hour h, minute m, seconds s and milliseconds ms.
Sourcepub fn format(&self, format: &QString) -> QString
pub fn format(&self, format: &QString) -> QString
Returns the time as a string. The format parameter determines the format of the result string.
Sourcepub fn format_enum(&self, format: DateFormat) -> QString
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 QTime
impl QTime
Sourcepub fn current_time() -> Self
pub fn current_time() -> Self
Returns the current time as reported by the system clock.
Sourcepub fn from_msecs_since_start_of_day(msecs: i32) -> Self
pub fn from_msecs_since_start_of_day(msecs: i32) -> Self
Returns a new QTime instance with the time set to the number of msecs since the start of the day, i.e. since 00:00:00.
Sourcepub fn from_string(string: &QString, format: &QString) -> Self
pub fn from_string(string: &QString, format: &QString) -> Self
Returns the QTime represented by the string, using the format given, or an invalid time if the string cannot be parsed.
Sourcepub fn from_string_enum(string: &QString, format: DateFormat) -> Self
pub fn from_string_enum(string: &QString, format: DateFormat) -> Self
Returns the time represented in the string as a QTime using the format given, or an invalid time if this is not possible.
Sourcepub fn msecs_to(&self, t: Self) -> i32
pub fn msecs_to(&self, t: Self) -> i32
Returns the number of milliseconds from this time to t. If t is earlier than this time, the number of milliseconds returned is negative.
Sourcepub fn new(h: i32, m: i32, s: i32, ms: i32) -> Self
pub fn new(h: i32, m: i32, s: i32, ms: i32) -> Self
Constructs a time with hour h, minute m, seconds s and milliseconds ms.