|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
![]() | ![]() |
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
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 pt1 and pt2. |
Method Summary | |
---|---|
int |
dx()
Returns the horizontal component of the line's vector. |
int |
dy()
Returns the vertical component of the line's vector. |
boolean |
equals(java.lang.Object other)
|
static QLine |
fromNativePointer(QNativePointer nativePointer)
This function returns the QLine instance pointed to by nativePointer |
boolean |
isNull()
Returns true if the line is not set up with valid start and end point; otherwise returns false. |
static QNativePointer |
nativePointerArray(QLine[] array)
This function returns a QNativePointer that is pointing to the specified QLine array. |
QPoint |
p1()
Returns the line's start point. |
QPoint |
p2()
Returns the line's end point. |
void |
readFrom(QDataStream arg__1)
Reads a QLine from arg__1. |
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 p. |
void |
writeTo(QDataStream arg__1)
Writes thisQLine to 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, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QLine(QPoint pt1, QPoint pt2)
Constructs a line object that represents the line between pt1 and pt2.
public QLine(int x1, int y1, int x2, int y2)
Constructs a line object that represents the line between (x1, y1) and (x2, y2).
public QLine()
Constructs a null line.
Method Detail |
---|
public final int dx()
Returns the horizontal component of the line's vector.
public final int dy()
Returns the vertical component of the line's vector.
public final boolean isNull()
Returns true if the line is not set up with valid start and end point; otherwise returns false.
public final void writeTo(QDataStream arg__1)
public final void readFrom(QDataStream arg__1)
public final QPoint p1()
Returns the line's start point.
public final QPoint p2()
Returns the line's end point.
public final void translate(int dx, int dy)
Translates this line the distance specified by dx and dy.
public final void translate(QPoint p)
Translates this line by the given p.
public final int x1()
Returns the x-coordinate of the line's start point.
public final int x2()
Returns the x-coordinate of the line's end point.
public final int y1()
Returns the y-coordinate of the line's start point.
public final int y2()
Returns the y-coordinate of the line's end point.
public static QLine fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QLine[] array)
array
- the array that the returned pointer will point to.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |