|
|
||||||||||
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.core.QPointF
public class QPointF
The QPointF class defines a point in the plane using floating point precision.
A point is specified by a x coordinate and an y coordinate which can be accessed using the x and y functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX and setY functions, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation).
Given a point p, the following statements are all equivalent:
QPointF p; p.setX(p.x() + 1.0); p += QPoint(1.0, 0.0); p.rx()++;
A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPointF object can also be divided or multiplied by an int or a qreal.
In addition, the QPointF class provides a constructor converting a QPoint object into a QPointF object, and a corresponding toPoint function which returns a QPoint copy of this point. Finally, QPointF objects can be streamed as well as compared.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, 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 | |
---|---|
QPointF()
Constructs a null point, i.e. with coordinates (0.0, 0.0) |
|
QPointF(double xpos,
double ypos)
Constructs a point with the given coordinates (xpos, ypos). |
|
QPointF(QPoint p)
Constructs a copy of the given p. |
Method Summary | |
---|---|
QPointF |
add(QPointF p)
Adds p to this QPointF and returns the result. |
QPointF |
divide(double d)
Divides this QPointF by deviser s and returns the result. |
boolean |
equals(java.lang.Object other)
|
static QPointF |
fromNativePointer(QNativePointer nativePointer)
This function returns the QPointF instance pointed to by nativePointer |
boolean |
isNull()
Returns true if both the x and y coordinates are set to 0.0, otherwise returns false. |
QPointF |
multiply(double d)
Multiplies this QPointF by factor d and returns the result. |
static QNativePointer |
nativePointerArray(QPointF[] array)
This function returns a QNativePointer that is pointing to the specified QPointF array. |
void |
readFrom(QDataStream arg__1)
Reads a QPointF from arg__1. |
void |
setX(double x)
Sets the x coordinate of this point to the given x coordinate. |
void |
setY(double y)
Sets the y coordinate of this point to the given y coordinate. |
QPointF |
subtract(QPointF p)
Subtracts p from this QPointF and returns the result. |
QPoint |
toPoint()
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates. |
void |
writeTo(QDataStream arg__1)
Writes thisQPointF to arg__1. |
double |
x()
Returns the x-coordinate of this point. |
double |
y()
Returns the y-coordinate of this 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 QPointF(double xpos, double ypos)
Constructs a point with the given coordinates (xpos, ypos).
public QPointF()
Constructs a null point, i.e. with coordinates (0.0, 0.0)
public QPointF(QPoint p)
Constructs a copy of the given p.
Method Detail |
---|
public final boolean isNull()
Returns true if both the x and y coordinates are set to 0.0, otherwise returns false.
public final void writeTo(QDataStream arg__1)
public final void readFrom(QDataStream arg__1)
public final void setX(double x)
Sets the x coordinate of this point to the given x coordinate.
public final void setY(double y)
Sets the y coordinate of this point to the given y coordinate.
public final QPoint toPoint()
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.
public final double x()
Returns the x-coordinate of this point.
public final double y()
Returns the y-coordinate of this point.
public static QPointF fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QPointF[] array)
array
- the array that the returned pointer will point to.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public final QPointF multiply(double d)
public final QPointF divide(double d)
public final QPointF add(QPointF p)
public final QPointF subtract(QPointF p)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |