Struct QLineF Copy item path Source #[repr(C)]
pub struct QLineF { }
Expand description The QLineF class provides a two-dimensional vector using floating point precision.
Returns the angle of the line in degrees.
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).
Returns the line’s start point.
Returns the line’s end point.
Returns the x-coordinate of the line’s start point.
Returns the x-coordinate of the line’s end point.
Returns the y-coordinate of the line’s start point.
Returns the y-coordinate of the line’s end point.
Returns the center point of this line. This is equivalent to (p1() + p2()) / 2, except it will never overflow.
Returns the horizontal component of the line’s vector.
Returns the vertical component of the line’s vector.
Returns true if the line does not have distinct start and end points; otherwise returns false.
Returns the length of the line.
Returns a line that is perpendicular to this line with the same starting point and length.
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.
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.
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, unless length() was previously zero, i
in which case no scaling is attempted. For lines with very short lengths (represented by denormal floating-point values), results may be imprecise.
Sets the starting point of this line to p1.
Sets the end point of this line to p2.
Sets this line to the start in x1, y1 and end in x2, y2.
Sets the start point of this line to p1 and the end point of this line to p2.
Returns an integer based copy of this line.
Translates this line by the given offset.
Returns this line translated by the given offset.
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, provided the line is non-null.
Constructs a line object that represents the line between pt1 and pt2.
Performs copy-assignment from
source
.
Read more Formats the value using the given formatter.
Read more Constructs a default qlinef
Formats the value using the given formatter.
Read more A type-level representation of the type’s C++ namespace and type name.
Read more Construct a QLineF object from the given integer-based line.
Returns an integer-based copy of this line.
Note that the returned line’s start and end points are rounded to the nearest integer.
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dest
.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String
.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.