#[repr(C)]pub struct QLine { /* private fields */ }
Expand description
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.
Implementations§
source§impl QLine
impl QLine
sourcepub unsafe fn center(&self) -> CppBox<QPoint>
pub unsafe fn center(&self) -> CppBox<QPoint>
sourcepub unsafe fn copy_from(&self, other: impl CastInto<Ref<QLine>>) -> Ref<QLine>
pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QLine>>) -> Ref<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.
sourcepub unsafe fn dx(&self) -> c_int
pub unsafe fn dx(&self) -> c_int
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().
sourcepub unsafe fn dy(&self) -> c_int
pub unsafe fn dy(&self) -> c_int
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().
sourcepub unsafe fn is_null(&self) -> bool
pub unsafe fn is_null(&self) -> bool
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
.
sourcepub unsafe fn new_0a() -> CppBox<QLine>
pub unsafe fn new_0a() -> CppBox<QLine>
Constructs a null line.
Calls C++ function: [constructor] void QLine::QLine()
.
Constructs a null line.
sourcepub unsafe fn new_2a(
pt1: impl CastInto<Ref<QPoint>>,
pt2: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
pub unsafe fn new_2a( 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.
sourcepub unsafe fn new_4a(
x1: c_int,
y1: c_int,
x2: c_int,
y2: c_int
) -> CppBox<QLine>
pub unsafe fn new_4a( 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).
sourcepub unsafe fn new_copy(other: impl CastInto<Ref<QLine>>) -> CppBox<QLine>
pub unsafe fn new_copy(other: impl CastInto<Ref<QLine>>) -> CppBox<QLine>
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.
sourcepub unsafe fn p1(&self) -> CppBox<QPoint>
pub unsafe fn p1(&self) -> CppBox<QPoint>
Returns the line's start point.
Calls C++ function: QPoint QLine::p1() const
.
sourcepub unsafe fn p2(&self) -> CppBox<QPoint>
pub unsafe fn p2(&self) -> CppBox<QPoint>
Returns the line's end point.
Calls C++ function: QPoint QLine::p2() const
.
sourcepub unsafe fn set_line(&self, x1: c_int, y1: c_int, x2: c_int, y2: c_int)
pub unsafe fn set_line(&self, x1: c_int, y1: c_int, x2: c_int, y2: c_int)
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)
.
sourcepub unsafe fn set_p1(&self, p1: impl CastInto<Ref<QPoint>>)
pub unsafe fn set_p1(&self, p1: impl CastInto<Ref<QPoint>>)
Sets the starting point of this line to p1.
Calls C++ function: void QLine::setP1(const QPoint& p1)
.
sourcepub unsafe fn set_p2(&self, p2: impl CastInto<Ref<QPoint>>)
pub unsafe fn set_p2(&self, p2: impl CastInto<Ref<QPoint>>)
Sets the end point of this line to p2.
Calls C++ function: void QLine::setP2(const QPoint& p2)
.
sourcepub unsafe fn set_points(
&self,
p1: impl CastInto<Ref<QPoint>>,
p2: impl CastInto<Ref<QPoint>>
)
pub unsafe fn set_points( &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)
.
sourcepub unsafe fn translate_1a(&self, p: impl CastInto<Ref<QPoint>>)
pub unsafe fn translate_1a(&self, p: impl CastInto<Ref<QPoint>>)
Translates this line by the given offset.
Calls C++ function: void QLine::translate(const QPoint& p)
.
Translates this line by the given offset.
sourcepub unsafe fn translate_2a(&self, dx: c_int, dy: c_int)
pub unsafe fn translate_2a(&self, dx: c_int, dy: c_int)
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.
sourcepub unsafe fn translated_1a(
&self,
p: impl CastInto<Ref<QPoint>>
) -> CppBox<QLine>
pub unsafe fn translated_1a( &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.
sourcepub unsafe fn translated_2a(&self, dx: c_int, dy: c_int) -> CppBox<QLine>
pub unsafe fn translated_2a(&self, dx: c_int, dy: c_int) -> CppBox<QLine>
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.
sourcepub unsafe fn x1(&self) -> c_int
pub unsafe fn x1(&self) -> c_int
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().
sourcepub unsafe fn x2(&self) -> c_int
pub unsafe fn x2(&self) -> c_int
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().
sourcepub unsafe fn y1(&self) -> c_int
pub unsafe fn y1(&self) -> c_int
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().
Trait Implementations§
source§impl CppDeletable for QLine
impl CppDeletable for QLine
source§unsafe fn delete(&self)
unsafe fn delete(&self)
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.
source§impl PartialEq<Ref<QLine>> for QLine
impl PartialEq<Ref<QLine>> for QLine
source§fn eq(&self, d: &Ref<QLine>) -> bool
fn eq(&self, d: &Ref<QLine>) -> bool
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.