-
首页
-
PyQt 4.11.4
-
所有类
-
模块
QPolygonF Class Reference
[
QtGui
module]
The QPolygonF class provides a vector of points using floating
point precision.
更多...
方法
-
__init__
(
self
)
-
__init__
(
self
, QPolygonF
a
)
-
__init__
(
self
, list-of-QPointF
v
)
-
__init__
(
self
, QRectF
r
)
-
__init__
(
self
, QPolygon
a
)
-
__init__
(
self
, int
asize
)
-
append
(
self
, QPointF
value
)
-
QPointF
at
(
self
, int
i
)
-
QRectF
boundingRect
(
self
)
-
clear
(
self
)
-
bool
contains
(
self
, QPointF
value
)
-
bool
containsPoint
(
self
, QPointF
pt
, Qt.FillRule
fillRule
)
-
int
count
(
self
, QPointF
value
)
-
int
count
(
self
)
-
sip.voidptr
data
(
self
)
-
fill
(
self
, QPointF
value
, int
size
= -1)
-
QPointF
first
(
self
)
-
int
indexOf
(
self
, QPointF
value
, int
from
= 0)
-
insert
(
self
, int
i
, QPointF
value
)
-
QPolygonF
intersected
(
self
, QPolygonF
r
)
-
bool
isClosed
(
self
)
-
bool
isEmpty
(
self
)
-
QPointF
last
(
self
)
-
int
lastIndexOf
(
self
, QPointF
value
, int
from
= -1)
-
QPolygonF
mid
(
self
, int
pos
, int
length
= -1)
-
prepend
(
self
, QPointF
value
)
-
remove
(
self
, int
i
)
-
remove
(
self
, int
i
, int
count
)
-
replace
(
self
, int
i
, QPointF
value
)
-
int
size
(
self
)
-
QPolygonF
subtracted
(
self
, QPolygonF
r
)
-
swap
(
self
, QPolygonF
other
)
-
QPolygon
toPolygon
(
self
)
-
translate
(
self
, QPointF
offset
)
-
translate
(
self
, float
dx
, float
dy
)
-
QPolygonF
translated
(
self
, QPointF
offset
)
-
QPolygonF
translated
(
self
, float
dx
, float
dy
)
-
QPolygonF
united
(
self
, QPolygonF
r
)
-
QPointF
value
(
self
, int
i
)
-
QPointF
value
(
self
, int
i
, QPointF
defaultValue
)
Special Methods
-
QPolygonF
__add__
(
self
, QPolygonF
other
)
-
int
__contains__
(
self
, QPointF
value
)
-
__delitem__
(
self
, int
i
)
-
__delitem__
(
self
, slice
slice
)
-
bool
__eq__
(
self
, QPolygonF
other
)
-
QPointF
__getitem__
(
self
, int
i
)
-
QPolygonF
__getitem__
(
self
, slice
slice
)
-
QPolygonF
__iadd__
(
self
, QPolygonF
other
)
-
QPolygonF
__iadd__
(
self
, QPointF
value
)
-
__len__
(
self
)
-
object
__lshift__
(
self
, QPointF
value
)
-
QPolygonF
__mul__
(
self
, QMatrix
m
)
-
QPolygonF
__mul__
(
self
, QTransform
m
)
-
bool
__ne__
(
self
, QPolygonF
other
)
-
__setitem__
(
self
, int
i
, QPointF
value
)
-
__setitem__
(
self
, slice
slice
, QPolygonF
list
)
详细描述
The QPolygonF class provides a vector of points using floating
point precision.
A QPolygonF is a
QVector
<
QPointF
>. The easiest way to add points to a
QPolygonF is to use its streaming operator, as illustrated
below:
QPolygonF polygon;
polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2);
In addition to the functions provided by
QVector
, QPolygonF provides the
boundingRect
() 和
translate
() functions for geometry
operations. Use the
QMatrix.map
()
function for more general transformations of QPolygonFs.
QPolygonF also provides the
isClosed
() function to determine
whether a polygon's start and end points are the same, and the
toPolygon
() function
returning an integer precision copy of this polygon.
The QPolygonF class is
implicitly
shared
.
方法文档编制
QPolygonF.__init__ (
self
)
Constructs a polygon with no points.
另请参阅
QVector.isEmpty
().
QPolygonF.__init__ (
self
,
QPolygonF
a
)
Constructs a polygon of the given
size
. Creates an empty
polygon if
size
== 0.
另请参阅
QVector.isEmpty
().
QPolygonF.__init__ (
self
, list-of-QPointF
v
)
构造副本为给定
polygon
.
QPolygonF.__init__ (
self
,
QRectF
r
)
Constructs a polygon containing the specified
points
.
QPolygonF.__init__ (
self
,
QPolygon
a
)
Constructs a closed polygon from the specified
rectangle
.
The polygon contains the four vertices of the rectangle in
clockwise order starting and ending with the top-left vertex.
另请参阅
isClosed
().
QPolygonF.__init__ (
self
, int
asize
)
Constructs a float based polygon from the specified integer
based
polygon
.
另请参阅
toPolygon
().
QPolygonF.append (
self
,
QPointF
value
)
QPointF
QPolygonF.at (
self
, int
i
)
QRectF
QPolygonF.boundingRect (
self
)
Returns the bounding rectangle of the polygon, or
QRectF
(0,0,0,0) if the polygon is empty.
另请参阅
QVector.isEmpty
().
QPolygonF.clear (
self
)
bool QPolygonF.contains (
self
,
QPointF
value
)
bool QPolygonF.containsPoint (
self
,
QPointF
pt
,
Qt.FillRule
fillRule
)
Returns true if the given
point
is inside the polygon
according to the specified
fillRule
;否则返回
false.
该函数在 Qt 4.3 引入。
int QPolygonF.count (
self
,
QPointF
value
)
int QPolygonF.count (
self
)
sip.voidptr QPolygonF.data (
self
)
QPolygonF.fill (
self
,
QPointF
value
, int
size
= -1)
QPointF
QPolygonF.first (
self
)
int QPolygonF.indexOf (
self
,
QPointF
value
, int
from
= 0)
QPolygonF.insert (
self
, int
i
,
QPointF
value
)
Returns a polygon which is the intersection of this polygon and
r
.
Set operations on polygons will treat the polygons as areas.
Non-closed polygons will be treated as implicitly closed.
该函数在 Qt 4.3 引入。
bool QPolygonF.isClosed (
self
)
Returns true if the polygon is closed; otherwise returns
false.
A polygon is said to be closed if its start point and end point
are equal.
另请参阅
QVector.first
() 和
QVector.last
().
bool QPolygonF.isEmpty (
self
)
QPointF
QPolygonF.last (
self
)
int QPolygonF.lastIndexOf (
self
,
QPointF
value
, int
from
= -1)
QPolygonF
QPolygonF.mid (
self
, int
pos
, int
length
= -1)
QPolygonF.prepend (
self
,
QPointF
value
)
QPolygonF.remove (
self
, int
i
)
QPolygonF.remove (
self
, int
i
, int
count
)
QPolygonF.replace (
self
, int
i
,
QPointF
value
)
int QPolygonF.size (
self
)
Returns a polygon which is
r
subtracted from this
polygon.
Set operations on polygons will treat the polygons as areas.
Non-closed polygons will be treated as implicitly closed.
该函数在 Qt 4.3 引入。
QPolygonF.swap (
self
,
QPolygonF
other
)
Swaps polygon
other
with this polygon. This operation is
very fast and never fails.
该函数在 Qt 4.8 引入。
QPolygon
QPolygonF.toPolygon (
self
)
创建和返回
QPolygon
by
converting each
QPointF
到
QPoint
.
另请参阅
QPointF.toPoint
().
QPolygonF.translate (
self
,
QPointF
offset
)
Translate all points in the polygon by the given
offset
.
另请参阅
translated
().
QPolygonF.translate (
self
, float
dx
, float
dy
)
这是重载函数。
Translates all points in the polygon by (
dx
,
dy
).
另请参阅
translated
().
QPolygonF
QPolygonF.translated (
self
,
QPointF
offset
)
Returns a copy of the polygon that is translated by the given
offset
.
该函数在 Qt 4.6 引入。
另请参阅
translate
().
QPolygonF
QPolygonF.translated (
self
, float
dx
, float
dy
)
这是重载函数。
Returns a copy of the polygon that is translated by (
dx
,
dy
).
该函数在 Qt 4.6 引入。
另请参阅
translate
().
Returns a polygon which is the union of this polygon and
r
.
Set operations on polygons will treat the polygons as areas.
Non-closed polygons will be treated as implicitly closed.
该函数在 Qt 4.3 引入。
另请参阅
intersected
() 和
subtracted
().
QPointF
QPolygonF.value (
self
, int
i
)
QPointF
QPolygonF.value (
self
, int
i
,
QPointF
defaultValue
)
int QPolygonF.__contains__ (
self
,
QPointF
value
)
QPolygonF.__delitem__ (
self
, int
i
)
QPolygonF.__delitem__ (
self
, slice
slice
)
bool QPolygonF.__eq__ (
self
,
QPolygonF
other
)
QPointF
QPolygonF.__getitem__ (
self
, int
i
)
QPolygonF
QPolygonF.__getitem__ (
self
, slice
slice
)
QPolygonF
QPolygonF.__iadd__ (
self
,
QPolygonF
other
)
QPolygonF
QPolygonF.__iadd__ (
self
,
QPointF
value
)
QPolygonF.__len__ (
self
)
object QPolygonF.__lshift__ (
self
,
QPointF
value
)
bool QPolygonF.__ne__ (
self
,
QPolygonF
other
)
QPolygonF.__setitem__ (
self
, int
i
,
QPointF
value
)
QPolygonF.__setitem__ (
self
, slice
slice
,
QPolygonF
list
)
-
首页
-
PyQt 4.11.4
-
文档编制