Struct QSize

Source
#[repr(C)]
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

Source

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.

Source§

impl QSize

Source

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.

Source§

impl QSize

Source

pub fn height(&self) -> i32

Returns the height.

Source§

impl QSize

Source

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.

Source§

impl QSize

Source

pub fn is_null(&self) -> bool

Returns true if both the width and height is 0; otherwise returns false.

Source§

impl QSize

Source

pub fn is_valid(&self) -> bool

Returns true if both the width and height is equal to or greater than 0; otherwise returns false.

Source§

impl QSize

Source

pub fn grown_by(&self, margins: QMargins) -> QSize

Returns the size that results from growing this size by margins.

Source§

impl QSize

Source

pub fn scale(&mut self, size: &QSize, mode: AspectRatioMode)

Scales the size to a rectangle with the given size, according to the specified mode.

Source§

impl QSize

Source

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.

Source§

impl QSize

Source

pub fn set_height(&mut self, height: i32)

Sets the height to the given height.

Source§

impl QSize

Source

pub fn set_width(&mut self, width: i32)

Sets the width to the given width.

Source§

impl QSize

Source

pub fn shrunk_by(&self, margins: QMargins) -> QSize

Returns the size that results from shrinking this size by margins.

Source§

impl QSize

Source

pub fn to_sizef(&self) -> QSizeF

Returns this size as a size with floating point accuracy. since 6.4

Source§

impl QSize

Source

pub fn transpose(&mut self)

Swaps the width and height values.

Source§

impl QSize

Source

pub fn transposed(&self) -> QSize

Returns a QSize with width and height swapped.

Source§

impl QSize

Source

pub fn width(&self) -> i32

Returns the width.

Source§

impl QSize

Source

pub fn new(width: i32, height: i32) -> Self

Constructs a size with the given width and height.

Trait Implementations§

Source§

impl Add for QSize

Source§

type Output = QSize

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl Clone for QSize

Source§

fn clone(&self) -> QSize

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 QSize

Source§

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

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

impl Default for QSize

Source§

fn default() -> Self

Constructs a size with an invalid width and height

Source§

impl Display for QSize

Source§

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

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

impl Div<f64> for QSize

Source§

type Output = QSize

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self

Performs the / operation. Read more
Source§

impl ExternType for QSize

Source§

type Id = (Q, S, i, z, e)

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

type Kind = Trivial

Source§

impl From<&QSize> for QSizeF

Source§

fn from(size: &QSize) -> Self

Constructs a size with floating point accuracy from the given size.

Source§

impl From<QSizeF> for QSize

Source§

fn from(size: QSizeF) -> Self

Returns an integer based copy of this size.

Note that the coordinates in the returned size will be rounded to the nearest integer.

Source§

impl Mul<f64> for QSize

Source§

type Output = QSize

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self

Performs the * operation. Read more
Source§

impl PartialEq for QSize

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl QListElement for QSize

Source§

type TypeId = (Q, L, i, s, t, __, Q, S, i, z, 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 QVariantValue for QSize

Source§

fn can_convert(variant: &QVariant) -> bool

Source§

fn construct(value: &Self) -> QVariant

Source§

fn value_or_default(variant: &QVariant) -> Self

Source§

impl QVectorElement for QSize

Source§

type TypeId = (Q, V, e, c, t, o, r, __, Q, S, i, z, 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 Sub for QSize

Source§

type Output = QSize

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl Eq for QSize

Source§

impl StructuralPartialEq for QSize

Auto Trait Implementations§

§

impl Freeze for QSize

§

impl RefUnwindSafe for QSize

§

impl Send for QSize

§

impl Sync for QSize

§

impl Unpin for QSize

§

impl UnwindSafe for QSize

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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§

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>,

Source§

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>,

Source§

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.