|  | Home · Overviews · Examples |

# QLine Class Reference
[com.trolltech.qt.gui module]

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

## Detailed Description

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.

See also `QLineF`, `QPolygon`, and `QRect`.