pub struct QSize { /* private fields */ }
Expand description
The QSize struct defines the size of a two-dimensional object using integer point precision.
Implementations§
Source§impl QSize
impl QSize
Sourcepub fn bounded_to(&self, other_size: &QSize) -> QSize
pub fn bounded_to(&self, other_size: &QSize) -> QSize
Returns a size holding the minimum width and height of this size and the given otherSize.
Sourcepub fn expanded_to(&self, other_size: &QSize) -> QSize
pub fn expanded_to(&self, other_size: &QSize) -> QSize
Returns a size holding the maximum width and height of this size and the given otherSize.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if both the width and height is 0; otherwise returns false.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
Sourcepub fn grown_by(&self, margins: QMargins) -> QSize
pub fn grown_by(&self, margins: QMargins) -> QSize
Returns the size that results from growing this size by margins.
Sourcepub fn scale(&mut self, size: &QSize, mode: AspectRatioMode)
pub fn scale(&mut self, size: &QSize, mode: AspectRatioMode)
Scales the size to a rectangle with the given size, according to the specified mode.
Sourcepub fn scaled(&self, s: &QSize, mode: AspectRatioMode) -> QSize
pub fn scaled(&self, s: &QSize, mode: AspectRatioMode) -> QSize
Return a size scaled to a rectangle with the given size s, according to the specified mode.
Sourcepub fn set_height(&mut self, height: i32)
pub fn set_height(&mut self, height: i32)
Sets the height to the given height.
Sourcepub fn shrunk_by(&self, margins: QMargins) -> QSize
pub fn shrunk_by(&self, margins: QMargins) -> QSize
Returns the size that results from shrinking this size by margins.
Sourcepub fn to_sizef(&self) -> QSizeF
pub fn to_sizef(&self) -> QSizeF
Returns this size as a size with floating point accuracy. since 6.4
Sourcepub fn transposed(&self) -> QSize
pub fn transposed(&self) -> QSize
Returns a QSize with width and height swapped.