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
impl QRectF
sourcepub fn bottom_left(&self) -> QPointF
pub fn bottom_left(&self) -> QPointF
Returns the position of the rectangle’s bottom-left corner.
source§impl QRectF
impl QRectF
sourcepub fn bottom_right(&self) -> QPointF
pub fn bottom_right(&self) -> QPointF
Returns the position of the rectangle’s bottom-right corner.
source§impl QRectF
impl QRectF
sourcepub fn intersected(&self, rectangle: &QRectF) -> QRectF
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
impl QRectF
sourcepub fn intersects(&self, rectangle: &QRectF) -> bool
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
impl QRectF
sourcepub fn is_valid(&self) -> bool
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
impl QRectF
sourcepub fn margins_added(&self, margins: &QMarginsF) -> QRectF
pub fn margins_added(&self, margins: &QMarginsF) -> QRectF
Returns a rectangle grown by the margins.
source§impl QRectF
impl QRectF
sourcepub fn margins_removed(&self, margins: &QMarginsF) -> QRectF
pub fn margins_removed(&self, margins: &QMarginsF) -> QRectF
Removes the margins from the rectangle, shrinking it.
source§impl QRectF
impl QRectF
sourcepub fn move_bottom(&mut self, y: f64)
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
impl QRectF
sourcepub fn move_bottom_left(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn move_bottom_right(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn move_center(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn move_right(&mut self, x: f64)
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
impl QRectF
sourcepub fn move_top_left(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn move_top_right(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn normalized(&self) -> QRectF
pub fn normalized(&self) -> QRectF
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
source§impl QRectF
impl QRectF
sourcepub fn set_bottom(&mut self, y: f64)
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
impl QRectF
sourcepub fn set_bottom_left(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn set_bottom_right(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn set_height(&mut self, h: f64)
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
impl QRectF
sourcepub fn set_top_left(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn set_top_right(&mut self, position: &QPointF)
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
impl QRectF
sourcepub fn to_aligned_rect(&self) -> QRect
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
impl QRectF
sourcepub fn translated(&self, offset: &QPointF) -> QRectF
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
impl QRectF
sourcepub fn transposed(&self) -> QRectF
pub fn transposed(&self) -> QRectF
Returns a copy of the rectangle that has its width and height exchanged.