pub struct QLine { /* private fields */ }
Expand description
The QLine class provides a two-dimensional vector using integer precision
Implementations§
Source§impl QLine
impl QLine
Sourcepub fn center(&self) -> QPoint
pub fn center(&self) -> QPoint
Returns the center point of this line. This is equivalent to (p1() + p2()) / 2, except it will never overflow.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if the line does not have distinct start and end points; otherwise returns false.
Sourcepub fn set_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)
pub fn set_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)
Sets this line to the start in x1, y1 and end in x2, y2.
Sourcepub fn set_points(&mut self, p1: &QPoint, p2: &QPoint)
pub fn set_points(&mut self, p1: &QPoint, p2: &QPoint)
Sets the start point of this line to p1 and the end point of this line to p2.
Sourcepub fn to_linef(&self) -> QLineF
pub fn to_linef(&self) -> QLineF
Returns this line as a line with floating point accuracy. since Qt 6.4.
Sourcepub fn translated(&self, offset: &QPoint) -> QLine
pub fn translated(&self, offset: &QPoint) -> QLine
Returns this line translated by the given offset.
Trait Implementations§
Source§impl ExternType for QLine
impl ExternType for QLine
Source§impl QListElement for QLine
impl QListElement for QLine
type TypeId = (Q, L, i, s, t, __, Q, L, i, n, e)
fn append(list: &mut QList<Self>, value: Self)
fn append_clone(list: &mut QList<Self>, value: &Self)
fn clear(list: &mut QList<Self>)
fn clone(list: &QList<Self>) -> QList<Self>
fn contains(list: &QList<Self>, value: &Self) -> bool
fn default() -> QList<Self>
fn drop(list: &mut QList<Self>)
fn index_of(list: &QList<Self>, value: &Self) -> isize
fn insert(list: &mut QList<Self>, pos: isize, value: Self)
fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)
fn len(list: &QList<Self>) -> isize
fn remove(list: &mut QList<Self>, pos: isize)
fn reserve(list: &mut QList<Self>, size: isize)
Source§impl QVectorElement for QLine
impl QVectorElement for QLine
type TypeId = (Q, V, e, c, t, o, r, __, Q, L, i, n, e)
fn append(vector: &mut QVector<Self>, value: Self)
fn append_clone(vector: &mut QVector<Self>, value: &Self)
fn clear(vector: &mut QVector<Self>)
fn clone(vector: &QVector<Self>) -> QVector<Self>
fn contains(vector: &QVector<Self>, value: &Self) -> bool
fn default() -> QVector<Self>
fn drop(vector: &mut QVector<Self>)
fn index_of(vector: &QVector<Self>, value: &Self) -> isize
fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)
fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)
fn len(vector: &QVector<Self>) -> isize
fn remove(vector: &mut QVector<Self>, pos: isize)
fn reserve(vector: &mut QVector<Self>, size: isize)
impl Eq for QLine
impl StructuralPartialEq for QLine
Auto Trait Implementations§
impl Freeze for QLine
impl RefUnwindSafe for QLine
impl Send for QLine
impl Sync for QLine
impl Unpin for QLine
impl UnwindSafe for QLine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more