Struct cxx_qt_lib::QRectF

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

The QRectF struct defines a rectangle in the plane using floating point precision.

Implementations§

source§

impl QRectF

source

pub fn adjust(&mut self, dx1: f64, dy1: f64, dx2: f64, dy2: f64)

Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle. All parameters must be finite.

source§

impl QRectF

source

pub fn adjusted(&self, dx1: f64, dy1: f64, dx2: f64, dy2: f64) -> QRectF

Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle. All parameters must be finite.

source§

impl QRectF

source

pub fn bottom(&self) -> f64

Returns the y-coordinate of the rectangle’s bottom edge.

source§

impl QRectF

source

pub fn bottom_left(&self) -> QPointF

Returns the position of the rectangle’s bottom-left corner.

source§

impl QRectF

source

pub fn bottom_right(&self) -> QPointF

Returns the position of the rectangle’s bottom-right corner.

source§

impl QRectF

source

pub fn center(&self) -> QPointF

Returns the center point of the rectangle.

source§

impl QRectF

source

pub fn contains(&self, point: &QPointF) -> bool

Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false.

source§

impl QRectF

source

pub fn height(&self) -> f64

Returns the height of the rectangle.

source§

impl QRectF

source

pub fn intersected(&self, rectangle: &QRectF) -> QRectF

Returns the intersection of this rectangle and the given rectangle. Note that r.intersected(s) is equivalent to r & s.

source§

impl QRectF

source

pub fn intersects(&self, rectangle: &QRectF) -> bool

Returns true if this rectangle intersects with the given rectangle (i.e. there is a non-empty area of overlap between them), otherwise returns false.

source§

impl QRectF

source

pub fn is_empty(&self) -> bool

Returns true if the rectangle is empty, otherwise returns false.

An empty rectangle has width() <= 0 or height() <= 0. An empty rectangle is not valid (i.e., isEmpty() == !isValid()).

source§

impl QRectF

source

pub fn is_null(&self) -> bool

Returns true if the rectangle is a null rectangle, otherwise returns false.

A null rectangle has both the width and the height set to 0. A null rectangle is also empty, and hence not valid.

source§

impl QRectF

source

pub fn is_valid(&self) -> bool

Returns true if the rectangle is valid, otherwise returns false.

A valid rectangle has a width() > 0 and height() > 0. Note that non-trivial operations like intersections are not defined for invalid rectangles. A valid rectangle is not empty (i.e., isValid() == !isEmpty()).

source§

impl QRectF

source

pub fn left(&self) -> f64

Returns the x-coordinate of the rectangle’s left edge. Equivalent to x().

source§

impl QRectF

source

pub fn margins_added(&self, margins: &QMarginsF) -> QRectF

Returns a rectangle grown by the margins.

source§

impl QRectF

source

pub fn margins_removed(&self, margins: &QMarginsF) -> QRectF

Removes the margins from the rectangle, shrinking it.

source§

impl QRectF

source

pub fn move_bottom(&mut self, y: f64)

Moves the rectangle vertically, leaving the rectangle’s bottom edge at the given finite y coordinate. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_bottom_left(&mut self, position: &QPointF)

Moves the rectangle, leaving the bottom-left corner at the given position. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_bottom_right(&mut self, position: &QPointF)

Moves the rectangle, leaving the bottom-right corner at the given position. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_center(&mut self, position: &QPointF)

Moves the rectangle, leaving the center point at the given position. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_left(&mut self, x: f64)

Moves the rectangle horizontally, leaving the rectangle’s left edge at the given finite x coordinate. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_right(&mut self, x: f64)

Moves the rectangle horizontally, leaving the rectangle’s right edge at the given finite x coordinate. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_to(&mut self, position: &QPointF)

Moves the rectangle, leaving the top-left corner at the given position.

source§

impl QRectF

source

pub fn move_top(&mut self, y: f64)

Moves the rectangle vertically, leaving the rectangle’s top line at the given finite y coordinate. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_top_left(&mut self, position: &QPointF)

Moves the rectangle, leaving the top-left corner at the given position. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn move_top_right(&mut self, position: &QPointF)

Moves the rectangle, leaving the top-right corner at the given position. The rectangle’s size is unchanged.

source§

impl QRectF

source

pub fn normalized(&self) -> QRectF

Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.

source§

impl QRectF

source

pub fn right(&self) -> f64

Returns the x-coordinate of the rectangle’s right edge.

source§

impl QRectF

source

pub fn set_bottom(&mut self, y: f64)

Sets the bottom edge of the rectangle to the given finite y coordinate. May change the height, but will never change the top edge of the rectangle.

source§

impl QRectF

source

pub fn set_bottom_left(&mut self, position: &QPointF)

Set the bottom-left corner of the rectangle to the given position. May change the size, but will never change the top-right corner of the rectangle.

source§

impl QRectF

source

pub fn set_bottom_right(&mut self, position: &QPointF)

Set the bottom-right corner of the rectangle to the given position. May change the size, but will never change the top-left corner of the rectangle.

source§

impl QRectF

source

pub fn set_coords(&mut self, x1: f64, y1: f64, x2: f64, y2: f64)

Sets the coordinates of the rectangle’s top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2). All parameters must be finite.

source§

impl QRectF

source

pub fn set_height(&mut self, h: f64)

Sets the height of the rectangle to the given finite height. The bottom edge is changed, but not the top one.

source§

impl QRectF

source

pub fn set_left(&mut self, x: f64)

Sets the left edge of the rectangle to the given finite x coordinate. May change the width, but will never change the right edge of the rectangle.

source§

impl QRectF

source

pub fn set_rect(&mut self, x: f64, y: f64, width: f64, height: f64)

Sets the coordinates of the rectangle’s top-left corner to (x, y), and its size to the given width and height. All parameters must be finite.

source§

impl QRectF

source

pub fn set_right(&mut self, x: f64)

Sets the right edge of the rectangle to the given finite x coordinate. May change the width, but will never change the left edge of the rectangle.

source§

impl QRectF

source

pub fn set_size(&mut self, size: &QSizeF)

Sets the size of the rectangle to the given finite size. The top-left corner is not moved.

source§

impl QRectF

source

pub fn set_top(&mut self, y: f64)

Sets the top edge of the rectangle to the given finite y coordinate. May change the height, but will never change the bottom edge of the rectangle.

source§

impl QRectF

source

pub fn set_top_left(&mut self, position: &QPointF)

Set the top-left corner of the rectangle to the given position. May change the size, but will never change the bottom-right corner of the rectangle.

source§

impl QRectF

source

pub fn set_top_right(&mut self, position: &QPointF)

Set the top-right corner of the rectangle to the given position. May change the size, but will never change the bottom-left corner of the rectangle.

source§

impl QRectF

source

pub fn set_width(&mut self, w: f64)

Sets the width of the rectangle to the given finite width. The right edge is changed, but not the left one.

source§

impl QRectF

source

pub fn set_x(&mut self, x: f64)

Sets the left edge of the rectangle to the given finite x coordinate. May change the width, but will never change the right edge of the rectangle.

source§

impl QRectF

source

pub fn set_y(&mut self, y: f64)

Sets the top edge of the rectangle to the given finite y coordinate. May change the height, but will never change the bottom edge of the rectangle.

source§

impl QRectF

source

pub fn size(&self) -> QSizeF

Returns the size of the rectangle.

source§

impl QRectF

source

pub fn to_aligned_rect(&self) -> QRect

Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle that completely contains this rectangle.

source§

impl QRectF

source

pub fn to_rect(&self) -> QRect

Returns a QRect based on the values of this rectangle. Note that the coordinates in the returned rectangle are rounded to the nearest integer.

source§

impl QRectF

source

pub fn top(&self) -> f64

Returns the y-coordinate of the rectangle’s top edge. Equivalent to y().

source§

impl QRectF

source

pub fn top_left(&self) -> QPointF

Returns the position of the rectangle’s top-left corner.

source§

impl QRectF

source

pub fn top_right(&self) -> QPointF

Returns the position of the rectangle’s top-right corner.

source§

impl QRectF

source

pub fn translate(&mut self, offset: &QPointF)

Moves the rectangle offset.x() along the x axis and offset.y() along the y axis, relative to the current position.

source§

impl QRectF

source

pub fn translated(&self, offset: &QPointF) -> QRectF

Returns a copy of the rectangle that is translated offset.x() along the x axis and offset.y() along the y axis, relative to the current position.

source§

impl QRectF

source

pub fn transposed(&self) -> QRectF

Returns a copy of the rectangle that has its width and height exchanged.

source§

impl QRectF

source

pub fn united(&self, rectangle: &QRectF) -> QRectF

Returns the bounding rectangle of this rectangle and the given rectangle.

source§

impl QRectF

source

pub fn width(&self) -> f64

Returns the width of the rectangle.

source§

impl QRectF

source

pub fn x(&self) -> f64

Returns the x-coordinate of the rectangle’s left edge.

source§

impl QRectF

source

pub fn y(&self) -> f64

Returns the y-coordinate of the rectangle’s top edge.

source§

impl QRectF

source

pub fn new(x: f64, y: f64, width: f64, height: f64) -> Self

Constructs a rectangle with (x, y) as its top-left corner and the given width and height.

Trait Implementations§

source§

impl Add<QMarginsF> for QRectF

§

type Output = QRectF

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Clone for QRectF

source§

fn clone(&self) -> QRectF

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 QRectF

source§

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

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

impl Default for QRectF

source§

fn default() -> Self

Constructs a null rectangle.

source§

impl Display for QRectF

source§

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

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

impl ExternType for QRectF

§

type Id = (Q, R, e, c, t, F)

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

type Kind = Trivial

source§

impl From<&QRect> for QRectF

source§

fn from(rectangle: &QRect) -> Self

Constructs a QRectF rectangle from the given QRect rectangle.

source§

impl From<&QRectF> for QRect

source§

fn from(value: &QRectF) -> Self

Returns a QRect based on the values of this rectangle. Note that the coordinates in the returned rectangle are rounded to the nearest integer.

source§

impl PartialEq for QRectF

source§

fn eq(&self, other: &QRectF) -> 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 QListElement for QRectF

§

type TypeId = (Q, L, i, s, t, __, Q, R, e, c, t, F)

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 QRectF

source§

impl QVectorElement for QRectF

§

type TypeId = (Q, V, e, c, t, o, r, __, Q, R, e, c, t, F)

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<QMarginsF> for QRectF

§

type Output = QRectF

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl StructuralPartialEq for QRectF

Auto Trait Implementations§

§

impl Freeze for QRectF

§

impl RefUnwindSafe for QRectF

§

impl Send for QRectF

§

impl Sync for QRectF

§

impl Unpin for QRectF

§

impl UnwindSafe for QRectF

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.