[][src]Struct qt_core::QLineF

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

The QLineF class provides a two-dimensional vector using floating point precision.

C++ class: QLineF.

C++ documentation:

The QLineF class provides a two-dimensional vector using floating point precision.

A QLineF describes a finite length line (or line segment) on a two-dimensional surface. QLineF defines the start and end points of the line using floating point accuracy for coordinates. Use the toLine() function to retrieve an integer based copy of this line.

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, respectively.

The line's length can be retrieved using the length() function, and altered using the setLength() function. Similarly, angle() and setAngle() are respectively used for retrieving and altering the angle of the line. Use the isNull() function to determine whether the QLineF represents a valid line or a null line.

The intersect() function determines the IntersectType for this line and a given line, while the angleTo() function returns the angle between the lines. In addition, the unitVector() function returns a line that has the same starting point as this line, but with a length of only 1, while the normalVector() function returns a line that is perpendicular to this line with the same starting point and length.

Finally, the line can be translated a given offset using the translate() function, and can be traversed using the pointAt() function.

Methods

impl QLineF[src]

pub unsafe fn angle_0a(&self) -> c_double[src]

Returns the angle (in degrees) between this line and the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

Calls C++ function: double QLineF::angle() const.

Warning: no exact match found in C++ documentation. Below is the C++ documentation for qreal QLineF::angle(const QLineF &line) const:

Returns the angle (in degrees) between this line and the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

When the lines are parallel, this function returns 0 if they have the same direction; otherwise it returns 180.

See also intersect().

pub unsafe fn angle_1a(&self, l: impl CastInto<Ref<QLineF>>) -> c_double[src]

Returns the angle (in degrees) between this line and the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

Calls C++ function: double QLineF::angle(const QLineF& l) const.

C++ documentation:

Returns the angle (in degrees) between this line and the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

When the lines are parallel, this function returns 0 if they have the same direction; otherwise it returns 180.

See also intersect().

pub unsafe fn angle_to(&self, l: impl CastInto<Ref<QLineF>>) -> c_double[src]

Returns the angle (in degrees) from this line to the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

Calls C++ function: double QLineF::angleTo(const QLineF& l) const.

C++ documentation:

Returns the angle (in degrees) from this line to the given line, taking the direction of the lines into account. If the lines do not intersect within their range, it is the intersection point of the extended lines that serves as origin (see QLineF::UnboundedIntersection).

The returned value represents the number of degrees you need to add to this line to make it have the same angle as the given line, going counter-clockwise.

This function was introduced in Qt 4.4.

See also intersect().

pub unsafe fn center(&self) -> CppBox<QPointF>[src]

Returns the center point of this line. This is equivalent to 0.5 * p1() + 0.5 * p2().

Calls C++ function: QPointF QLineF::center() const.

C++ documentation:

Returns the center point of this line. This is equivalent to 0.5 * p1() + 0.5 * p2().

This function was introduced in Qt 5.8.

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

The QLineF class provides a two-dimensional vector using floating point precision.

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

C++ documentation:

The QLineF class provides a two-dimensional vector using floating point precision.

A QLineF describes a finite length line (or line segment) on a two-dimensional surface. QLineF defines the start and end points of the line using floating point accuracy for coordinates. Use the toLine() function to retrieve an integer based copy of this line.

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, respectively.

The line's length can be retrieved using the length() function, and altered using the setLength() function. Similarly, angle() and setAngle() are respectively used for retrieving and altering the angle of the line. Use the isNull() function to determine whether the QLineF represents a valid line or a null line.

The intersect() function determines the IntersectType for this line and a given line, while the angleTo() function returns the angle between the lines. In addition, the unitVector() function returns a line that has the same starting point as this line, but with a length of only 1, while the normalVector() function returns a line that is perpendicular to this line with the same starting point and length.

Finally, the line can be translated a given offset using the translate() function, and can be traversed using the pointAt() function.

pub unsafe fn dx(&self) -> c_double[src]

Returns the horizontal component of the line's vector.

Calls C++ function: double QLineF::dx() const.

C++ documentation:

Returns the horizontal component of the line's vector.

See also dy() and pointAt().

pub unsafe fn dy(&self) -> c_double[src]

Returns the vertical component of the line's vector.

Calls C++ function: double QLineF::dy() const.

C++ documentation:

Returns the vertical component of the line's vector.

See also dx() and pointAt().

pub unsafe fn from_polar(length: c_double, angle: c_double) -> CppBox<QLineF>[src]

Returns a QLineF with the given length and angle.

Calls C++ function: static QLineF QLineF::fromPolar(double length, double angle).

C++ documentation:

Returns a QLineF with the given length and angle.

The first point of the line will be on the origin.

Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.

This function was introduced in Qt 4.4.

pub unsafe fn intersect(
    &self,
    l: impl CastInto<Ref<QLineF>>,
    intersection_point: impl CastInto<MutPtr<QPointF>>
) -> IntersectType
[src]

Returns a value indicating whether or not this line intersects with the given line.

Calls C++ function: QLineF::IntersectType QLineF::intersect(const QLineF& l, QPointF* intersectionPoint) const.

C++ documentation:

Returns a value indicating whether or not this line intersects with the given line.

The actual intersection point is extracted to intersectionPoint (if the pointer is valid). If the lines are parallel, the intersection point is undefined.

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 QLineF::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 length(&self) -> c_double[src]

Returns the length of the line.

Calls C++ function: double QLineF::length() const.

C++ documentation:

Returns the length of the line.

See also setLength().

pub unsafe fn new_0a() -> CppBox<QLineF>[src]

Constructs a null line.

Calls C++ function: [constructor] void QLineF::QLineF().

C++ documentation:

Constructs a null line.

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

Constructs a line object that represents the line between p1 and p2.

Calls C++ function: [constructor] void QLineF::QLineF(const QPointF& pt1, const QPointF& pt2).

C++ documentation:

Constructs a line object that represents the line between p1 and p2.

pub unsafe fn new_4a(
    x1: c_double,
    y1: c_double,
    x2: c_double,
    y2: c_double
) -> CppBox<QLineF>
[src]

Constructs a line object that represents the line between (x1, y1) and (x2, y2).

Calls C++ function: [constructor] void QLineF::QLineF(double x1, double y1, double x2, double y2).

C++ documentation:

Constructs a line object that represents the line between (x1, y1) and (x2, y2).

pub unsafe fn new_1a(line: impl CastInto<Ref<QLine>>) -> CppBox<QLineF>[src]

Construct a QLineF object from the given integer-based line.

Calls C++ function: [constructor] void QLineF::QLineF(const QLine& line).

C++ documentation:

Construct a QLineF object from the given integer-based line.

See also toLine().

pub unsafe fn new_copy(other: impl CastInto<Ref<QLineF>>) -> CppBox<QLineF>[src]

The QLineF class provides a two-dimensional vector using floating point precision.

Calls C++ function: [constructor] void QLineF::QLineF(const QLineF& other).

C++ documentation:

The QLineF class provides a two-dimensional vector using floating point precision.

A QLineF describes a finite length line (or line segment) on a two-dimensional surface. QLineF defines the start and end points of the line using floating point accuracy for coordinates. Use the toLine() function to retrieve an integer based copy of this line.

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, respectively.

The line's length can be retrieved using the length() function, and altered using the setLength() function. Similarly, angle() and setAngle() are respectively used for retrieving and altering the angle of the line. Use the isNull() function to determine whether the QLineF represents a valid line or a null line.

The intersect() function determines the IntersectType for this line and a given line, while the angleTo() function returns the angle between the lines. In addition, the unitVector() function returns a line that has the same starting point as this line, but with a length of only 1, while the normalVector() function returns a line that is perpendicular to this line with the same starting point and length.

Finally, the line can be translated a given offset using the translate() function, and can be traversed using the pointAt() function.

pub unsafe fn normal_vector(&self) -> CppBox<QLineF>[src]

Returns a line that is perpendicular to this line with the same starting point and length.

Calls C++ function: QLineF QLineF::normalVector() const.

C++ documentation:

Returns a line that is perpendicular to this line with the same starting point and length.

See also unitVector().

pub unsafe fn p1(&self) -> CppBox<QPointF>[src]

Returns the line's start point.

Calls C++ function: QPointF QLineF::p1() const.

C++ documentation:

Returns the line's start point.

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

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

Returns the line's end point.

Calls C++ function: QPointF QLineF::p2() const.

C++ documentation:

Returns the line's end point.

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

pub unsafe fn point_at(&self, t: c_double) -> CppBox<QPointF>[src]

Returns the point at the parameterized position specified by t. The function returns the line's start point if t = 0, and its end point if t = 1.

Calls C++ function: QPointF QLineF::pointAt(double t) const.

C++ documentation:

Returns the point at the parameterized position specified by t. The function returns the line's start point if t = 0, and its end point if t = 1.

See also dx() and dy().

pub unsafe fn set_angle(&mut self, angle: c_double)[src]

Sets the angle of the line to the given angle (in degrees). This will change the position of the second point of the line such that the line has the given angle.

Calls C++ function: void QLineF::setAngle(double angle).

C++ documentation:

Sets the angle of the line to the given angle (in degrees). This will change the position of the second point of the line such that the line has the given angle.

Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.

This function was introduced in Qt 4.4.

See also angle().

pub unsafe fn set_length(&mut self, len: c_double)[src]

Sets the length of the line to the given length. QLineF will move the end point - p2() - of the line to give the line its new length.

Calls C++ function: void QLineF::setLength(double len).

C++ documentation:

Sets the length of the line to the given length. QLineF will move the end point - p2() - of the line to give the line its new length.

If the line is a null line, the length will remain zero regardless of the length specified.

See also length() and isNull().

pub unsafe fn set_line(
    &mut self,
    x1: c_double,
    y1: c_double,
    x2: c_double,
    y2: c_double
)
[src]

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

Calls C++ function: void QLineF::setLine(double x1, double y1, double x2, double 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(&mut self, p1: impl CastInto<Ref<QPointF>>)[src]

Sets the starting point of this line to p1.

Calls C++ function: void QLineF::setP1(const QPointF& 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(&mut self, p2: impl CastInto<Ref<QPointF>>)[src]

Sets the end point of this line to p2.

Calls C++ function: void QLineF::setP2(const QPointF& 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(
    &mut self,
    p1: impl CastInto<Ref<QPointF>>,
    p2: impl CastInto<Ref<QPointF>>
)
[src]

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

Calls C++ function: void QLineF::setPoints(const QPointF& p1, const QPointF& 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 to_line(&self) -> CppBox<QLine>[src]

Returns an integer based copy of this line.

Calls C++ function: QLine QLineF::toLine() const.

C++ documentation:

Returns an integer based copy of this line.

Note that the returned line's start and end points are rounded to the nearest integer.

See also QLineF().

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

Translates this line by the given offset.

Calls C++ function: void QLineF::translate(const QPointF& p).

C++ documentation:

Translates this line by the given offset.

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

This is an overloaded function.

Calls C++ function: void QLineF::translate(double dx, double 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<QPointF>>
) -> CppBox<QLineF>
[src]

Returns this line translated by the given offset.

Calls C++ function: QLineF QLineF::translated(const QPointF& 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_double, dy: c_double) -> CppBox<QLineF>[src]

This is an overloaded function.

Calls C++ function: QLineF QLineF::translated(double dx, double 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 unit_vector(&self) -> CppBox<QLineF>[src]

Returns the unit vector for this line, i.e a line starting at the same point as this line with a length of 1.0.

Calls C++ function: QLineF QLineF::unitVector() const.

C++ documentation:

Returns the unit vector for this line, i.e a line starting at the same point as this line with a length of 1.0.

See also normalVector().

pub unsafe fn x1(&self) -> c_double[src]

Returns the x-coordinate of the line's start point.

Calls C++ function: double QLineF::x1() const.

C++ documentation:

Returns the x-coordinate of the line's start point.

See also p1().

pub unsafe fn x2(&self) -> c_double[src]

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

Calls C++ function: double QLineF::x2() const.

C++ documentation:

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

See also p2().

pub unsafe fn y1(&self) -> c_double[src]

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

Calls C++ function: double QLineF::y1() const.

C++ documentation:

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

See also p1().

pub unsafe fn y2(&self) -> c_double[src]

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

Calls C++ function: double QLineF::y2() const.

C++ documentation:

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

See also p2().

Trait Implementations

impl PartialEq<Ref<QLineF>> for QLineF[src]

fn eq(&self, d: &Ref<QLineF>) -> bool[src]

Returns true if the given line is the same as this line.

Calls C++ function: bool QLineF::operator==(const QLineF& 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.

impl CppDeletable for QLineF[src]

unsafe fn delete(&mut self)[src]

The QLineF class provides a two-dimensional vector using floating point precision.

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

C++ documentation:

The QLineF class provides a two-dimensional vector using floating point precision.

A QLineF describes a finite length line (or line segment) on a two-dimensional surface. QLineF defines the start and end points of the line using floating point accuracy for coordinates. Use the toLine() function to retrieve an integer based copy of this line.

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, respectively.

The line's length can be retrieved using the length() function, and altered using the setLength() function. Similarly, angle() and setAngle() are respectively used for retrieving and altering the angle of the line. Use the isNull() function to determine whether the QLineF represents a valid line or a null line.

The intersect() function determines the IntersectType for this line and a given line, while the angleTo() function returns the angle between the lines. In addition, the unitVector() function returns a line that has the same starting point as this line, but with a length of only 1, while the normalVector() function returns a line that is perpendicular to this line with the same starting point and length.

Finally, the line can be translated a given offset using the translate() function, and can be traversed using the pointAt() function.

Auto Trait Implementations

impl Send for QLineF

impl Sync for QLineF

impl Unpin for QLineF

impl UnwindSafe for QLineF

impl RefUnwindSafe for QLineF

Blanket Implementations

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

impl<T> From<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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

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