Table Of Contents

Previous topic

QPainterPath.Element

Next topic

QPolygon

QPolygonF

Inheritance diagram of QPolygonF

Synopsis

Functions

Static functions

Detailed Description

The PySide.QtGui.QPolygonF class provides a vector of points using floating point precision.

A PySide.QtGui.QPolygonF is a QVector < PySide.QtCore.QPointF >. The easiest way to add points to a PySide.QtGui.QPolygonF is to use its streaming operator, as illustrated below:

polygon = QPolygonF()
polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2)

In addition to the functions provided by QVector , PySide.QtGui.QPolygonF provides the PySide.QtGui.QPolygonF.boundingRect() and PySide.QtGui.QPolygonF.translate() functions for geometry operations. Use the QMatrix.map() function for more general transformations of QPolygonFs.

PySide.QtGui.QPolygonF also provides the PySide.QtGui.QPolygonF.isClosed() function to determine whether a polygon’s start and end points are the same, and the PySide.QtGui.QPolygonF.toPolygon() function returning an integer precision copy of this polygon.

The PySide.QtGui.QPolygonF class is implicitly shared .

class PySide.QtGui.QPolygonF
class PySide.QtGui.QPolygonF(a)
class PySide.QtGui.QPolygonF(a)
class PySide.QtGui.QPolygonF(r)
class PySide.QtGui.QPolygonF(v)
class PySide.QtGui.QPolygonF(size)
Parameters:

Constructs a polygon with no points.

See also

QVector.isEmpty()

Constructs a float based polygon from the specified integer based polygon .

Constructs a copy of the given polygon .

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.

Constructs a polygon of the given size . Creates an empty polygon if size == 0.

See also

QVector.isEmpty()

PySide.QtGui.QPolygonF.alignOfTypedData()
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.append(t)
Parameters:tPySide.QtCore.QPointF
PySide.QtGui.QPolygonF.at(i)
Parameters:iPySide.QtCore.int
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.boundingRect()
Return type:PySide.QtCore.QRectF

Returns the bounding rectangle of the polygon, or PySide.QtCore.QRectF (0,0,0,0) if the polygon is empty.

See also

QVector.isEmpty()

PySide.QtGui.QPolygonF.capacity()
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.clear()
PySide.QtGui.QPolygonF.constData()
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.contains(t)
Parameters:tPySide.QtCore.QPointF
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.containsPoint(pt, fillRule)
Parameters:
Return type:

PySide.QtCore.bool

PySide.QtGui.QPolygonF.count()
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.count(t)
Parameters:tPySide.QtCore.QPointF
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.data()
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.detach_helper()
PySide.QtGui.QPolygonF.empty()
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.endsWith(t)
Parameters:tPySide.QtCore.QPointF
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.erase(abegin, aend)
Parameters:
Return type:

PySide.QtCore.QPointF

PySide.QtGui.QPolygonF.fill(t[, size=-1])
Parameters:
Return type:

PySide.QtGui.QPolygonF.first()
Return type:PySide.QtCore.QPointF
static PySide.QtGui.QPolygonF.fromList(list)
Parameters:list
Return type:
PySide.QtGui.QPolygonF.front()
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.indexOf(t[, from=0])
Parameters:
Return type:

PySide.QtCore.int

PySide.QtGui.QPolygonF.insert(i, n, t)
Parameters:
PySide.QtGui.QPolygonF.insert(before, n, t)
Parameters:
Return type:

PySide.QtCore.QPointF

PySide.QtGui.QPolygonF.insert(i, t)
Parameters:
PySide.QtGui.QPolygonF.intersected(r)
Parameters:rPySide.QtGui.QPolygonF
Return type:PySide.QtGui.QPolygonF

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.

PySide.QtGui.QPolygonF.isClosed()
Return type:PySide.QtCore.bool

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.

See also

QVector.first() QVector.last()

PySide.QtGui.QPolygonF.isEmpty()
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.isSharedWith(other)
Parameters:other
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.last()
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.lastIndexOf(t[, from=-1])
Parameters:
Return type:

PySide.QtCore.int

PySide.QtGui.QPolygonF.mid(pos[, length=-1])
Parameters:
  • posPySide.QtCore.int
  • lengthPySide.QtCore.int
Return type:

PySide.QtGui.QPolygonF.__ne__(v)
Parameters:v
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.__mul__(m)
Parameters:mPySide.QtGui.QTransform
Return type:PySide.QtGui.QPolygonF
PySide.QtGui.QPolygonF.__mul__(m)
Parameters:mPySide.QtGui.QMatrix
Return type:PySide.QtGui.QPolygonF
PySide.QtGui.QPolygonF.__add__(l)
Parameters:l
Return type:
PySide.QtGui.QPolygonF.__iadd__(l)
Parameters:l
Return type:
PySide.QtGui.QPolygonF.__iadd__(l)
Parameters:l
Return type:
PySide.QtGui.QPolygonF.__iadd__(t)
Parameters:tPySide.QtCore.QPointF
Return type:
PySide.QtGui.QPolygonF.__eq__(v)
Parameters:v
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.operator[](i)
Parameters:iPySide.QtCore.int
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.pop_back()
PySide.QtGui.QPolygonF.pop_front()
PySide.QtGui.QPolygonF.prepend(t)
Parameters:tPySide.QtCore.QPointF
PySide.QtGui.QPolygonF.push_back(t)
Parameters:tPySide.QtCore.QPointF
PySide.QtGui.QPolygonF.push_front(t)
Parameters:tPySide.QtCore.QPointF
PySide.QtGui.QPolygonF.realloc(size, alloc)
Parameters:
  • sizePySide.QtCore.int
  • allocPySide.QtCore.int
PySide.QtGui.QPolygonF.remove(i, n)
Parameters:
  • iPySide.QtCore.int
  • nPySide.QtCore.int
PySide.QtGui.QPolygonF.remove(i)
Parameters:iPySide.QtCore.int
PySide.QtGui.QPolygonF.replace(i, t)
Parameters:
PySide.QtGui.QPolygonF.reserve(size)
Parameters:sizePySide.QtCore.int
PySide.QtGui.QPolygonF.resize(size)
Parameters:sizePySide.QtCore.int
PySide.QtGui.QPolygonF.setSharable(sharable)
Parameters:sharablePySide.QtCore.bool
PySide.QtGui.QPolygonF.size()
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.sizeOfTypedData()
Return type:PySide.QtCore.int
PySide.QtGui.QPolygonF.squeeze()
PySide.QtGui.QPolygonF.startsWith(t)
Parameters:tPySide.QtCore.QPointF
Return type:PySide.QtCore.bool
PySide.QtGui.QPolygonF.subtracted(r)
Parameters:rPySide.QtGui.QPolygonF
Return type:PySide.QtGui.QPolygonF

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.

PySide.QtGui.QPolygonF.toList()
Return type:
PySide.QtGui.QPolygonF.toPolygon()
Return type:PySide.QtGui.QPolygon

Creates and returns a PySide.QtGui.QPolygon by converting each PySide.QtCore.QPointF to a PySide.QtCore.QPoint .

See also

QPointF.toPoint()

PySide.QtGui.QPolygonF.translate(offset)
Parameters:offsetPySide.QtCore.QPointF

Translate all points in the polygon by the given offset .

PySide.QtGui.QPolygonF.translate(dx, dy)
Parameters:
  • dxPySide.QtCore.qreal
  • dyPySide.QtCore.qreal

This is an overloaded function.

Translates all points in the polygon by (dx , dy ).

PySide.QtGui.QPolygonF.translated(dx, dy)
Parameters:
  • dxPySide.QtCore.qreal
  • dyPySide.QtCore.qreal
Return type:

PySide.QtGui.QPolygonF

This is an overloaded function.

Returns a copy of the polygon that is translated by (dx , dy ).

PySide.QtGui.QPolygonF.translated(offset)
Parameters:offsetPySide.QtCore.QPointF
Return type:PySide.QtGui.QPolygonF

Returns a copy of the polygon that is translated by the given offset .

PySide.QtGui.QPolygonF.united(r)
Parameters:rPySide.QtGui.QPolygonF
Return type:PySide.QtGui.QPolygonF

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.

PySide.QtGui.QPolygonF.value(i)
Parameters:iPySide.QtCore.int
Return type:PySide.QtCore.QPointF
PySide.QtGui.QPolygonF.value(i, defaultValue)
Parameters:
Return type:

PySide.QtCore.QPointF