[][src]Struct qt_core::QLine

#[repr(C)]pub struct QLine { /* fields omitted */ }

The QLine class provides a two-dimensional vector using integer precision.

C++ class: QLine.

C++ documentation:

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.

C++ documentation:

Returns the center point of this line. This is equivalent to (p1() + p2()) / 2, except it will never overflow.

This function was introduced in Qt 5.8.

pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QLine>>) -> Ref<QLine>[src]

The QLine class provides a two-dimensional vector using integer precision.

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

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

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().

C++ documentation:

Constructs a null line.

pub unsafe fn new_2a(
    pt1: impl CastInto<Ref<QPoint>>,
    pt2: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
[src]

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).

C++ documentation:

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]

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).

C++ documentation:

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).

C++ documentation:

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.

C++ documentation:

Returns the line's start point.

See also setP1(), x1(), y1(), and p2().

pub unsafe fn p2(&self) -> CppBox<QPoint>[src]

Returns the line's end point.

Calls C++ function: QPoint QLine::p2() const.

C++ documentation:

Returns the line's end point.

See also setP2(), x2(), y2(), and p1().

pub unsafe fn set_line(&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).

C++ documentation:

Sets this line to the start in x1, y1 and end in x2, y2.

This function was introduced in Qt 4.4.

See also setP1(), setP2(), p1(), and p2().

pub unsafe fn set_p1(&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).

C++ documentation:

Sets the starting point of this line to p1.

This function was introduced in Qt 4.4.

See also setP2() and p1().

pub unsafe fn set_p2(&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).

C++ documentation:

Sets the end point of this line to p2.

This function was introduced in Qt 4.4.

See also setP1() and p2().

pub unsafe fn set_points(
    &self,
    p1: impl CastInto<Ref<QPoint>>,
    p2: impl CastInto<Ref<QPoint>>
)
[src]

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).

C++ documentation:

Sets the start point of this line to p1 and the end point of this line to p2.

This function was introduced in Qt 4.4.

See also setP1(), setP2(), p1(), and p2().

pub unsafe fn translate_1a(&self, p: impl CastInto<Ref<QPoint>>)[src]

Translates this line by the given offset.

Calls C++ function: void QLine::translate(const QPoint& p).

C++ documentation:

Translates this line by the given offset.

pub unsafe fn translate_2a(&self, dx: c_int, dy: c_int)[src]

This is an overloaded function.

Calls C++ function: void QLine::translate(int dx, int dy).

C++ documentation:

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]

Returns this line translated by the given offset.

Calls C++ function: QLine QLine::translated(const QPoint& p) const.

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

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.

C++ documentation:

Returns the y-coordinate of the line's end point.

See also p2().

Trait Implementations

impl CppDeletable for QLine[src]

unsafe fn delete(&self)[src]

The QLine class provides a two-dimensional vector using integer precision.

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

C++ documentation:

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.

C++ documentation:

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.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.