[−][src]Struct qt_core::QLine
The QLine class provides a two-dimensional vector using integer precision.
C++ class: QLine
.
The QLine class provides a two-dimensional vector using integer precision.
A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.
The positions of the line's start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.
Finally, the line can be translated a given offset using the translate() function.
Methods
impl QLine
[src]
pub unsafe fn center(&self) -> CppBox<QPoint>
[src]
Returns the center point of this line. This is equivalent to (p1() + p2()) / 2, except it will never overflow.
Calls C++ function: QPoint QLine::center() const
.
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QLine>>
) -> MutRef<QLine>
[src]
&mut self,
other: impl CastInto<Ref<QLine>>
) -> MutRef<QLine>
The QLine class provides a two-dimensional vector using integer precision.
Calls C++ function: QLine& QLine::operator=(const QLine& other)
.
The QLine class provides a two-dimensional vector using integer precision.
A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.
The positions of the line's start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.
Finally, the line can be translated a given offset using the translate() function.
pub unsafe fn dx(&self) -> c_int
[src]
Returns the horizontal component of the line's vector.
Calls C++ function: int QLine::dx() const
.
Returns the horizontal component of the line's vector.
See also dy().
pub unsafe fn dy(&self) -> c_int
[src]
Returns the vertical component of the line's vector.
Calls C++ function: int QLine::dy() const
.
Returns the vertical component of the line's vector.
See also dx().
pub unsafe fn is_null(&self) -> bool
[src]
Returns true
if the line is not set up with valid start and end point; otherwise returns false
.
Calls C++ function: bool QLine::isNull() const
.
Returns true
if the line is not set up with valid start and end point; otherwise returns false
.
pub unsafe fn new_0a() -> CppBox<QLine>
[src]
Constructs a null line.
Calls C++ function: [constructor] void QLine::QLine()
.
Constructs a null line.
pub unsafe fn new_2a(
pt1: impl CastInto<Ref<QPoint>>,
pt2: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
[src]
pt1: impl CastInto<Ref<QPoint>>,
pt2: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
Constructs a line object that represents the line between p1 and p2.
Calls C++ function: [constructor] void QLine::QLine(const QPoint& pt1, const QPoint& pt2)
.
Constructs a line object that represents the line between p1 and p2.
pub unsafe fn new_4a(
x1: c_int,
y1: c_int,
x2: c_int,
y2: c_int
) -> CppBox<QLine>
[src]
x1: c_int,
y1: c_int,
x2: c_int,
y2: c_int
) -> CppBox<QLine>
Constructs a line object that represents the line between (x1, y1) and (x2, y2).
Calls C++ function: [constructor] void QLine::QLine(int x1, int y1, int x2, int y2)
.
Constructs a line object that represents the line between (x1, y1) and (x2, y2).
pub unsafe fn new_copy(other: impl CastInto<Ref<QLine>>) -> CppBox<QLine>
[src]
The QLine class provides a two-dimensional vector using integer precision.
Calls C++ function: [constructor] void QLine::QLine(const QLine& other)
.
The QLine class provides a two-dimensional vector using integer precision.
A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.
The positions of the line's start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.
Finally, the line can be translated a given offset using the translate() function.
pub unsafe fn p1(&self) -> CppBox<QPoint>
[src]
Returns the line's start point.
Calls C++ function: QPoint QLine::p1() const
.
pub unsafe fn p2(&self) -> CppBox<QPoint>
[src]
Returns the line's end point.
Calls C++ function: QPoint QLine::p2() const
.
pub unsafe fn set_line(&mut self, x1: c_int, y1: c_int, x2: c_int, y2: c_int)
[src]
Sets this line to the start in x1, y1 and end in x2, y2.
Calls C++ function: void QLine::setLine(int x1, int y1, int x2, int y2)
.
pub unsafe fn set_p1(&mut self, p1: impl CastInto<Ref<QPoint>>)
[src]
Sets the starting point of this line to p1.
Calls C++ function: void QLine::setP1(const QPoint& p1)
.
pub unsafe fn set_p2(&mut self, p2: impl CastInto<Ref<QPoint>>)
[src]
Sets the end point of this line to p2.
Calls C++ function: void QLine::setP2(const QPoint& p2)
.
pub unsafe fn set_points(
&mut self,
p1: impl CastInto<Ref<QPoint>>,
p2: impl CastInto<Ref<QPoint>>
)
[src]
&mut self,
p1: impl CastInto<Ref<QPoint>>,
p2: impl CastInto<Ref<QPoint>>
)
Sets the start point of this line to p1 and the end point of this line to p2.
Calls C++ function: void QLine::setPoints(const QPoint& p1, const QPoint& p2)
.
pub unsafe fn translate_1a(&mut self, p: impl CastInto<Ref<QPoint>>)
[src]
Translates this line by the given offset.
Calls C++ function: void QLine::translate(const QPoint& p)
.
Translates this line by the given offset.
pub unsafe fn translate_2a(&mut self, dx: c_int, dy: c_int)
[src]
This is an overloaded function.
Calls C++ function: void QLine::translate(int dx, int dy)
.
This is an overloaded function.
Translates this line the distance specified by dx and dy.
pub unsafe fn translated_1a(
&self,
p: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
[src]
&self,
p: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
Returns this line translated by the given offset.
Calls C++ function: QLine QLine::translated(const QPoint& p) const
.
Returns this line translated by the given offset.
This function was introduced in Qt 4.4.
pub unsafe fn translated_2a(&self, dx: c_int, dy: c_int) -> CppBox<QLine>
[src]
This is an overloaded function.
Calls C++ function: QLine QLine::translated(int dx, int dy) const
.
This is an overloaded function.
Returns this line translated the distance specified by dx and dy.
This function was introduced in Qt 4.4.
pub unsafe fn x1(&self) -> c_int
[src]
Returns the x-coordinate of the line's start point.
Calls C++ function: int QLine::x1() const
.
Returns the x-coordinate of the line's start point.
See also p1().
pub unsafe fn x2(&self) -> c_int
[src]
Returns the x-coordinate of the line's end point.
Calls C++ function: int QLine::x2() const
.
Returns the x-coordinate of the line's end point.
See also p2().
pub unsafe fn y1(&self) -> c_int
[src]
Returns the y-coordinate of the line's start point.
Calls C++ function: int QLine::y1() const
.
Returns the y-coordinate of the line's start point.
See also p1().
pub unsafe fn y2(&self) -> c_int
[src]
Returns the y-coordinate of the line's end point.
Calls C++ function: int QLine::y2() const
.
Returns the y-coordinate of the line's end point.
See also p2().
Trait Implementations
impl CppDeletable for QLine
[src]
unsafe fn delete(&mut self)
[src]
The QLine class provides a two-dimensional vector using integer precision.
Calls C++ function: [destructor] void QLine::~QLine()
.
The QLine class provides a two-dimensional vector using integer precision.
A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.
The positions of the line's start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.
Finally, the line can be translated a given offset using the translate() function.
impl PartialEq<Ref<QLine>> for QLine
[src]
fn eq(&self, d: &Ref<QLine>) -> bool
[src]
Returns true
if the given line is the same as this line.
Calls C++ function: bool QLine::operator==(const QLine& d) const
.
Returns true
if the given line is the same as this line.
A line is identical to another line if the start and end points are identical, and the internal order of the points is the same.
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for QLine
impl Send for QLine
impl Sync for QLine
impl Unpin for QLine
impl UnwindSafe for QLine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,