Struct qt_core::QMargins

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

The QMargins class defines the four margins of a rectangle.

C++ class: QMargins.

C++ documentation:

The QMargins class defines the four margins of a rectangle.

QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() function returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

Implementations§

source§

impl QMargins

source

pub unsafe fn add_assign_q_margins( &self, margins: impl CastInto<Ref<QMargins>> ) -> Ref<QMargins>

Add each component of margins to the respective component of this object and returns a reference to it.

Calls C++ function: QMargins& QMargins::operator+=(const QMargins& margins).

C++ documentation:

Add each component of margins to the respective component of this object and returns a reference to it.

This function was introduced in Qt 5.1.

See also operator-=().

source

pub unsafe fn add_assign_int(&self, arg1: c_int) -> Ref<QMargins>

This is an overloaded function.

Calls C++ function: QMargins& QMargins::operator+=(int arg1).

C++ documentation:

This is an overloaded function.

Adds the addend to each component of this object and returns a reference to it.

See also operator-=().

source

pub unsafe fn bottom(&self) -> c_int

Returns the bottom margin.

Calls C++ function: int QMargins::bottom() const.

C++ documentation:

Returns the bottom margin.

See also setBottom().

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QMargins>> ) -> Ref<QMargins>

The QMargins class defines the four margins of a rectangle.

Calls C++ function: QMargins& QMargins::operator=(const QMargins& other).

C++ documentation:

The QMargins class defines the four margins of a rectangle.

QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() function returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

source

pub unsafe fn div_assign_int(&self, arg1: c_int) -> Ref<QMargins>

Divides each component of this object by divisor and returns a reference to it.

Calls C++ function: QMargins& QMargins::operator/=(int arg1).

C++ documentation:

Divides each component of this object by divisor and returns a reference to it.

This function was introduced in Qt 5.1.

See also operator*=().

source

pub unsafe fn div_assign_double(&self, arg1: c_double) -> Ref<QMargins>

This is an overloaded function.

Calls C++ function: QMargins& QMargins::operator/=(double arg1).

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.1.

See also operator*=().

source

pub unsafe fn is_null(&self) -> bool

Returns true if all margins are is 0; otherwise returns false.

Calls C++ function: bool QMargins::isNull() const.

C++ documentation:

Returns true if all margins are is 0; otherwise returns false.

source

pub unsafe fn left(&self) -> c_int

Returns the left margin.

Calls C++ function: int QMargins::left() const.

C++ documentation:

Returns the left margin.

See also setLeft().

source

pub unsafe fn mul_assign_int(&self, arg1: c_int) -> Ref<QMargins>

Multiplies each component of this object by factor and returns a reference to it.

Calls C++ function: QMargins& QMargins::operator*=(int arg1).

C++ documentation:

Multiplies each component of this object by factor and returns a reference to it.

This function was introduced in Qt 5.1.

See also operator/=().

source

pub unsafe fn mul_assign_double(&self, arg1: c_double) -> Ref<QMargins>

This is an overloaded function.

Calls C++ function: QMargins& QMargins::operator*=(double arg1).

C++ documentation:

This is an overloaded function.

Multiplies each component of this object by factor and returns a reference to it.

This function was introduced in Qt 5.1.

See also operator/=().

source

pub unsafe fn neg(&self) -> CppBox<QMargins>

Calls C++ function: QMargins operator-(const QMargins& margins).

source

pub unsafe fn new_0a() -> CppBox<QMargins>

Constructs a margins object with all margins set to 0.

Calls C++ function: [constructor] void QMargins::QMargins().

C++ documentation:

Constructs a margins object with all margins set to 0.

See also isNull().

source

pub unsafe fn new_4a( left: c_int, top: c_int, right: c_int, bottom: c_int ) -> CppBox<QMargins>

Constructs margins with the given left, top, right, bottom

Calls C++ function: [constructor] void QMargins::QMargins(int left, int top, int right, int bottom).

C++ documentation:

Constructs margins with the given left, top, right, bottom

See also setLeft(), setRight(), setTop(), and setBottom().

source

pub unsafe fn new_copy(other: impl CastInto<Ref<QMargins>>) -> CppBox<QMargins>

The QMargins class defines the four margins of a rectangle.

Calls C++ function: [constructor] void QMargins::QMargins(const QMargins& other).

C++ documentation:

The QMargins class defines the four margins of a rectangle.

QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() function returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

source

pub unsafe fn right(&self) -> c_int

Returns the right margin.

Calls C++ function: int QMargins::right() const.

C++ documentation:

Returns the right margin.

See also setRight().

source

pub unsafe fn set_bottom(&self, bottom: c_int)

Sets the bottom margin to bottom.

Calls C++ function: void QMargins::setBottom(int bottom).

C++ documentation:

Sets the bottom margin to bottom.

See also bottom().

source

pub unsafe fn set_left(&self, left: c_int)

Sets the left margin to left.

Calls C++ function: void QMargins::setLeft(int left).

C++ documentation:

Sets the left margin to left.

See also left().

source

pub unsafe fn set_right(&self, right: c_int)

Sets the right margin to right.

Calls C++ function: void QMargins::setRight(int right).

C++ documentation:

Sets the right margin to right.

See also right().

source

pub unsafe fn set_top(&self, top: c_int)

Sets the Top margin to Top.

Calls C++ function: void QMargins::setTop(int top).

C++ documentation:

Sets the Top margin to Top.

See also top().

source

pub unsafe fn sub_assign_q_margins( &self, margins: impl CastInto<Ref<QMargins>> ) -> Ref<QMargins>

Subtract each component of margins from the respective component of this object and returns a reference to it.

Calls C++ function: QMargins& QMargins::operator-=(const QMargins& margins).

C++ documentation:

Subtract each component of margins from the respective component of this object and returns a reference to it.

This function was introduced in Qt 5.1.

See also operator+=().

source

pub unsafe fn sub_assign_int(&self, arg1: c_int) -> Ref<QMargins>

This is an overloaded function.

Calls C++ function: QMargins& QMargins::operator-=(int arg1).

C++ documentation:

This is an overloaded function.

Subtracts the subtrahend from each component of this object and returns a reference to it.

See also operator+=().

source

pub unsafe fn top(&self) -> c_int

Returns the top margin.

Calls C++ function: int QMargins::top() const.

C++ documentation:

Returns the top margin.

See also setTop().

source

pub unsafe fn unary_plus(&self) -> CppBox<QMargins>

Calls C++ function: QMargins operator+(const QMargins& margins).

Trait Implementations§

source§

impl Add<Ref<QMargins>> for &QMargins

source§

fn add(self, m2: Ref<QMargins>) -> CppBox<QMargins>

Calls C++ function: QMargins operator+(const QMargins& m1, const QMargins& m2).

§

type Output = CppBox<QMargins>

The resulting type after applying the + operator.
source§

impl Add<Ref<QRect>> for &QMargins

source§

fn add(self, rectangle: Ref<QRect>) -> CppBox<QRect>

Calls C++ function: QRect operator+(const QMargins& margins, const QRect& rectangle).

§

type Output = CppBox<QRect>

The resulting type after applying the + operator.
source§

impl Add<i32> for &QMargins

source§

fn add(self, rhs: c_int) -> CppBox<QMargins>

Calls C++ function: QMargins operator+(const QMargins& lhs, int rhs).

§

type Output = CppBox<QMargins>

The resulting type after applying the + operator.
source§

impl CppDeletable for QMargins

source§

unsafe fn delete(&self)

The QMargins class defines the four margins of a rectangle.

Calls C++ function: [destructor] void QMargins::~QMargins().

C++ documentation:

The QMargins class defines the four margins of a rectangle.

QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() function returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

source§

impl Div<f64> for &QMargins

source§

fn div(self, divisor: c_double) -> CppBox<QMargins>

This is an overloaded function.

Calls C++ function: QMargins operator/(const QMargins& margins, double divisor).

C++ documentation:

This is an overloaded function.

Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.

This function was introduced in Qt 5.1.

See also QMargins::operator*=() and QMargins::operator/=().

§

type Output = CppBox<QMargins>

The resulting type after applying the / operator.
source§

impl Div<i32> for &QMargins

source§

fn div(self, divisor: c_int) -> CppBox<QMargins>

Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.

Calls C++ function: QMargins operator/(const QMargins& margins, int divisor).

C++ documentation:

Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.

This function was introduced in Qt 5.1.

See also QMargins::operator*=() and QMargins::operator/=().

§

type Output = CppBox<QMargins>

The resulting type after applying the / operator.
source§

impl Mul<f64> for &QMargins

source§

fn mul(self, factor: c_double) -> CppBox<QMargins>

This is an overloaded function.

Calls C++ function: QMargins operator*(const QMargins& margins, double factor).

C++ documentation:

This is an overloaded function.

Returns a QMargins object that is formed by multiplying each component of the given margins by factor.

This function was introduced in Qt 5.1.

See also QMargins::operator*=() and QMargins::operator/=().

§

type Output = CppBox<QMargins>

The resulting type after applying the * operator.
source§

impl Mul<i32> for &QMargins

source§

fn mul(self, factor: c_int) -> CppBox<QMargins>

Returns a QMargins object that is formed by multiplying each component of the given margins by factor.

Calls C++ function: QMargins operator*(const QMargins& margins, int factor).

C++ documentation:

Returns a QMargins object that is formed by multiplying each component of the given margins by factor.

This function was introduced in Qt 5.1.

See also QMargins::operator*=() and QMargins::operator/=().

§

type Output = CppBox<QMargins>

The resulting type after applying the * operator.
source§

impl PartialEq<Ref<QMargins>> for QMargins

source§

fn eq(&self, m2: &Ref<QMargins>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QMargins& m1, const QMargins& m2).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

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 Sub<Ref<QMargins>> for &QMargins

source§

fn sub(self, m2: Ref<QMargins>) -> CppBox<QMargins>

Calls C++ function: QMargins operator-(const QMargins& m1, const QMargins& m2).

§

type Output = CppBox<QMargins>

The resulting type after applying the - operator.
source§

impl Sub<i32> for &QMargins

source§

fn sub(self, rhs: c_int) -> CppBox<QMargins>

Calls C++ function: QMargins operator-(const QMargins& lhs, int rhs).

§

type Output = CppBox<QMargins>

The resulting type after applying the - operator.

Auto Trait Implementations§

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, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. 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> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. 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.