- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# QLine Class Reference

Search for all occurrences

## Detailed Description

Definition at line 57 of file qline.h.

`#include <qline.h>`

List of all members.

## Public Member Functions
| QLine ()
| QLine (const QPoint &pt1, const QPoint &pt2)
| QLine (int x1, int y1, int x2, int y2)
bool | isNull () const
QPoint | p1 () const
QPoint | p2 () const
int | x1 () const
int | y1 () const
int | x2 () const
int | y2 () const
int | dx () const
int | dy () const
void | translate (const QPoint &p)
void | translate (int dx, int dy)
QLine | translated (const QPoint &p) const
QLine | translated (int dx, int dy) const
void | setP1 (const QPoint &p1)
void | setP2 (const QPoint &p2)
void | setPoints (const QPoint &p1, const QPoint &p2)
void | setLine (int x1, int y1, int x2, int y2)
bool | operator== (const QLine &d) const
bool | operator!= (const QLine &d) const

## Constructor & Destructor Documentation

QLine | ( |  | ) | `[inline]`

Definition at line 101 of file qline.h.

    { }

QLine | ( | const QPoint & | pt1,
|  | const QPoint & | pt2
| ) |  | `[inline]`

Definition at line 103 of file qline.h.

    : pt1(pt1_), pt2(pt2_) { }

QLine | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2
| ) |  | `[inline]`

Definition at line 105 of file qline.h.

    : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }

## Member Function Documentation

bool isNull | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 107 of file qline.h.

    {
        return pt1 == pt2;
    }

QPoint p1 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 132 of file qline.h.

    {
        return pt1;
    }

QPoint p2 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 137 of file qline.h.

    {
        return pt2;
    }

int x1 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 112 of file qline.h.

    {
        return pt1.x();
    }

int y1 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 117 of file qline.h.

    {
        return pt1.y();
    }

int x2 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 122 of file qline.h.

    {
        return pt2.x();
    }

int y2 | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 127 of file qline.h.

    {
        return pt2.y();
    }

int dx | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 142 of file qline.h.

    {
        return pt2.x() - pt1.x();
    }

int dy | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 147 of file qline.h.

    {
        return pt2.y() - pt1.y();
    }

void translate | ( | const QPoint & | p | ) | `[inline]`

Search for all occurrences

Definition at line 152 of file qline.h.

    {
        pt1 += point;
        pt2 += point;
    }

void translate | ( | int | dx,
|  | int | dy
| ) |  | `[inline]`

Search for all occurrences

Definition at line 158 of file qline.h.

    {
        this->translate(QPoint(adx, ady));
    }

QLine translated | ( | const QPoint & | p | ) | const `[inline]`

Search for all occurrences

Definition at line 163 of file qline.h.

    {
        return QLine(pt1 + p, pt2 + p);
    }

QLine translated | ( | int | dx,
|  | int | dy
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 168 of file qline.h.

    {
        return translated(QPoint(adx, ady));
    }

void setP1 | ( | const QPoint & | p1 | ) | `[inline]`

Search for all occurrences

Definition at line 173 of file qline.h.

    {
        pt1 = aP1;
    }

void setP2 | ( | const QPoint & | p2 | ) | `[inline]`

Search for all occurrences

Definition at line 178 of file qline.h.

    {
        pt2 = aP2;
    }

void setPoints | ( | const QPoint & | p1,
|  | const QPoint & | p2
| ) |  | `[inline]`

Search for all occurrences

Definition at line 183 of file qline.h.

    {
        pt1 = aP1;
        pt2 = aP2;
    }

void setLine | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2
| ) |  | `[inline]`

Search for all occurrences

Definition at line 189 of file qline.h.

    {
        pt1 = QPoint(aX1, aY1);
        pt2 = QPoint(aX2, aY2);
    }

bool operator== | ( | const QLine & | d | ) | const `[inline]`

Definition at line 195 of file qline.h.

    {
        return pt1 == d.pt1 && pt2 == d.pt2;
    }

bool operator!= | ( | const QLine & | d | ) | const `[inline]`

Definition at line 90 of file qline.h.

    { return !(*this == d); }

The documentation for this class was generated from the following file:

- QtCore/qline.h

QLine QLine QLine QLine QLine QLine QLine QLine QLine QLine
QLine QLine QLine QLine QLine QLine QLine QLine QLine QLine