|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QLine
public 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.
![]() | ![]() |
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.
QLineF
, QPolygon
, and QRect
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QLine()
Constructs a null line. |
|
QLine(int x1,
int y1,
int x2,
int y2)
Constructs a line object that represents the line between (x1, y1) and (x2, y2). |
|
QLine(QPoint pt1,
QPoint pt2)
Constructs a line object that represents the line between p1 and p2. |
Method Summary | |
---|---|
QLine |
clone()
This method is reimplemented for internal reasons |
int |
dx()
Returns the horizontal component of the line's vector. |
int |
dy()
Returns the vertical component of the line's vector. |
boolean |
isNull()
Returns true if the line is not set up with valid start and end point; otherwise returns false. |
QPoint |
p1()
Returns the line's start point. |
QPoint |
p2()
Returns the line's end point. |
void |
readFrom(QDataStream arg__1)
|
void |
setLine(int x1,
int y1,
int x2,
int y2)
Sets this line to the start in x1, y1 and end in x2, y2. |
void |
setP1(QPoint p1)
Sets the starting point of this line to p1. |
void |
setP2(QPoint p2)
Sets the end point of this line to p2. |
void |
setPoints(QPoint p1,
QPoint p2)
Sets the start point of this line to p1 and the end point of this line to p2. |
java.lang.String |
toString()
|
void |
translate(int dx,
int dy)
Translates this line the distance specified by dx and dy. |
void |
translate(QPoint p)
Translates this line by the given offset. |
QLine |
translated(int dx,
int dy)
Returns this line translated the distance specified by dx and dy. |
QLine |
translated(QPoint p)
Returns this line translated by the given offset. |
void |
writeTo(QDataStream arg__1)
|
int |
x1()
Returns the x-coordinate of the line's start point. |
int |
x2()
Returns the x-coordinate of the line's end point. |
int |
y1()
Returns the y-coordinate of the line's start point. |
int |
y2()
Returns the y-coordinate of the line's end point. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QLine()
public QLine(QPoint pt1, QPoint pt2)
public QLine(int x1, int y1, int x2, int y2)
Method Detail |
---|
public final int dx()
dy()
.
public final int dy()
dx()
.
public final boolean isNull()
public final void writeTo(QDataStream arg__1)
public final void readFrom(QDataStream arg__1)
public final QPoint p1()
setP1()
, x1()
, y1()
, and p2()
.
public final QPoint p2()
setP2()
, x2()
, y2()
, and p1()
.
public final void setLine(int x1, int y1, int x2, int y2)
setP1()
, setP2()
, p1()
, and p2()
.
public final void setP1(QPoint p1)
setP2()
, and p1()
.
public final void setP2(QPoint p2)
setP1()
, and p2()
.
public final void setPoints(QPoint p1, QPoint p2)
setP1()
, setP2()
, p1()
, and p2()
.
public final void translate(QPoint p)
public final void translate(int dx, int dy)
public final QLine translated(QPoint p)
public final QLine translated(int dx, int dy)
public final int x1()
p1()
.
public final int x2()
p2()
.
public final int y1()
p1()
.
public final int y2()
p2()
.
public java.lang.String toString()
toString
in class java.lang.Object
public QLine clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |