def
__add__
()
def
__add__
(, p2)
def
__div__
(, divisor)
def
__eq__
(, p2)
def
__iadd__
(p)
def
__idiv__
(c)
def
__imul__
(c)
def
__isub__
(p)
def
__mul__
(, c)
def
__mul__
(, m)
def
__mul__
(, m)
def
__mul__
(, matrix)
def
__mul__
(c)
def
__mul__
(matrix)
def
__ne__
(, p2)
def
__reduce__
()
def
__repr__
()
def
__sub__
()
def
__sub__
(, p2)
def
isNull
()
def
manhattanLength
()
def
setX
(x)
def
setY
(y)
def
toPoint
()
def
toTuple
()
def
transposed
()
def
x
()
def
y
()
def
dotProduct
(p1, p2)
A point is specified by a x coordinate and an y coordinate which can be accessed using the
x()andy()functions. The coordinates of the point are specified using floating point numbers for accuracy. TheisNull()function returnstrueif both x and y are set to 0.0. The coordinates can be set (or altered) using thesetX()andsetY()functions, or alternatively therx()andry()functions which return references to the coordinates (allowing direct manipulation).Given a point p , the following statements are all equivalent:
p = QPointF() p.setX(p.x() + 1.0) p += QPointF(1.0, 0.0) #p.rx()++;A
QPointFobject can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). AQPointFobject can also be divided or multiplied by anint或qreal.此外,
QPointFclass provides a constructor converting aQPointobject into aQPointFobject, and a correspondingtoPoint()function which returns aQPointcopy of this point. Finally,QPointFobjects can be streamed as well as compared.
QPointF
¶
构造 null 点,即具有坐标 (0.0, 0.0)
另请参阅
构造副本为给定
point
.
另请参阅
构造点采用给定坐标 (
xpos
,
ypos
).
PySide2.QtCore.QPointF.
__reduce__
(
)
¶
PyObject
PySide2.QtCore.QPointF.
__repr__
(
)
¶
PyObject
PySide2.QtCore.QPointF.
dotProduct
(
p1
,
p2
)
¶
QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
int lengthSquared = QPointF::dotProduct(p, q); // lengthSquared becomes 26.01
Returns the dot product of
p1
and
p2
.
PySide2.QtCore.QPointF.
isNull
(
)
¶
bool
返回
true
if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns
false
.
PySide2.QtCore.QPointF.
manhattanLength
(
)
¶
qreal
Returns the sum of the absolute values of
x()
and
y()
, traditionally known as the “Manhattan length” of the vector from the origin to the point.
另请参阅
PySide2.QtCore.QPointF.
__imul__
(
c
)
¶
c
–
qreal
Multiplies this point’s coordinates by the given
factor
, and returns a reference to this point. For example:
p = QPointF(-1.1, 4.1)
p *= 2.5 # p becomes (-2.75, 10.25)
另请参阅
operator/=()
PySide2.QtCore.QPointF.
__iadd__
(
p
)
¶
添加给定
point
to this point and returns a reference to this point. For example:
p = QPointF( 3.1, 7.1)
q = QPointF(-1.0, 4.1)
p += q # p becomes (2.1, 11.2)
另请参阅
operator-=()
PySide2.QtCore.QPointF.
__isub__
(
p
)
¶
Subtracts the given
point
from this point and returns a reference to this point. For example:
p = QPointF( 3.1, 7.1)
q = QPointF(-1.0, 4.1)
p -= q # p becomes (4.1, 3.0)
另请参阅
operator+=()
PySide2.QtCore.QPointF.
__idiv__
(
c
)
¶
c
–
qreal
Divides both x and y by the given
divisor
, and returns a reference to this point. For example:
p = QPointF(-2.75, 10.25)
p /= 2.5 # p becomes (-1.1, 4.1)
另请参阅
operator*=()
PySide2.QtCore.QPointF.
setX
(
x
)
¶
x
–
qreal
Sets the x coordinate of this point to the given
x
坐标。
PySide2.QtCore.QPointF.
setY
(
y
)
¶
y
–
qreal
Sets the y coordinate of this point to the given
y
坐标。
PySide2.QtCore.QPointF.
toPoint
(
)
¶
Rounds the coordinates of this point to the nearest integer, and returns a
QPoint
object with the rounded coordinates.
另请参阅
QPointF()
PySide2.QtCore.QPointF.
toTuple
(
)
¶
PyObject
PySide2.QtCore.QPointF.
transposed
(
)
¶
Returns a point with x and y coordinates exchanged:
QPointF{1.0, 2.0}.transposed() // {2.0, 1.0}