QLine Class Reference

QLine Class Reference

#include <qline.h>

Class Description

Definition at line 57 of file qline.h.

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.

101 { }
QLine ( const QPoint pt1,
const QPoint pt2 
)
inline

Definition at line 103 of file qline.h.

103 : pt1(pt1_), pt2(pt2_) { }
QLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Definition at line 105 of file qline.h.

105 : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
Definition: qpoint.h:53

Member Function Documentation

bool isNull ( ) const
inline

Definition at line 107 of file qline.h.

108 {
109  return pt1 == pt2;
110 }
QPoint p1 ( ) const
inline

Definition at line 132 of file qline.h.

133 {
134  return pt1;
135 }
QPoint p2 ( ) const
inline

Definition at line 137 of file qline.h.

138 {
139  return pt2;
140 }
int x1 ( ) const
inline

Definition at line 112 of file qline.h.

113 {
114  return pt1.x();
115 }
int x() const
Definition: qpoint.h:128
int y1 ( ) const
inline

Definition at line 117 of file qline.h.

118 {
119  return pt1.y();
120 }
int y() const
Definition: qpoint.h:131
int x2 ( ) const
inline

Definition at line 122 of file qline.h.

123 {
124  return pt2.x();
125 }
int x() const
Definition: qpoint.h:128
int y2 ( ) const
inline

Definition at line 127 of file qline.h.

128 {
129  return pt2.y();
130 }
int y() const
Definition: qpoint.h:131
int dx ( ) const
inline

Definition at line 142 of file qline.h.

143 {
144  return pt2.x() - pt1.x();
145 }
int x() const
Definition: qpoint.h:128
int dy ( ) const
inline

Definition at line 147 of file qline.h.

148 {
149  return pt2.y() - pt1.y();
150 }
int y() const
Definition: qpoint.h:131
void translate ( const QPoint p)
inline

Definition at line 152 of file qline.h.

153 {
154  pt1 += point;
155  pt2 += point;
156 }
void translate ( int  dx,
int  dy 
)
inline

Definition at line 158 of file qline.h.

159 {
160  this->translate(QPoint(adx, ady));
161 }
Definition: qpoint.h:53
void translate(const QPoint &p)
Definition: qline.h:152
QLine translated ( const QPoint p) const
inline

Definition at line 163 of file qline.h.

164 {
165  return QLine(pt1 + p, pt2 + p);
166 }
QLine()
Definition: qline.h:101
QLine translated ( int  dx,
int  dy 
) const
inline

Definition at line 168 of file qline.h.

169 {
170  return translated(QPoint(adx, ady));
171 }
Definition: qpoint.h:53
QLine translated(const QPoint &p) const
Definition: qline.h:163
void setP1 ( const QPoint p1)
inline

Definition at line 173 of file qline.h.

174 {
175  pt1 = aP1;
176 }
void setP2 ( const QPoint p2)
inline

Definition at line 178 of file qline.h.

179 {
180  pt2 = aP2;
181 }
void setPoints ( const QPoint p1,
const QPoint p2 
)
inline

Definition at line 183 of file qline.h.

184 {
185  pt1 = aP1;
186  pt2 = aP2;
187 }
void setLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Definition at line 189 of file qline.h.

190 {
191  pt1 = QPoint(aX1, aY1);
192  pt2 = QPoint(aX2, aY2);
193 }
Definition: qpoint.h:53
bool operator== ( const QLine d) const
inline

Definition at line 195 of file qline.h.

196 {
197  return pt1 == d.pt1 && pt2 == d.pt2;
198 }
bool operator!= ( const QLine d) const
inline

Definition at line 90 of file qline.h.

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

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