Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QPainterPath Class Reference

List of all members.


Detailed Description

The QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused.

A painter path is an object composed of a number of graphical building blocks, such as rectangles, ellipses, lines, and curves. Building blocks can be joined in closed subpaths, for example as a rectangle or an ellipse. A closed path has coinciding start and end points. Or they can exist independently as unclosed subpaths, such as lines and curves.

A QPainterPath object can be used for filling, outlining, and clipping. To generate fillable outlines for a given painter path, use the QPainterPathStroker class. The main advantage of painter paths over normal drawing operations is that complex shapes only need to be created once; then they can be drawn many times using only calls to the QPainter::drawPath() function.

QPainterPath provides a collection of functions that can be used to obtain information about the path and its elements. In addition it is possible to reverse the order of the elements using the toReversed() function. There are also several functions to convert this painter path object into a polygon representation.

Definition at line 66 of file qpainterpath.h.


Public Types

enum  ElementType { MoveToElement, LineToElement, CurveToElement, CurveToDataElement }

Public Member Functions

void addEllipse (const QPointF &center, qreal rx, qreal ry)
void addEllipse (qreal x, qreal y, qreal w, qreal h)
void addEllipse (const QRectF &rect)
void addPath (const QPainterPath &path)
void addPolygon (const QPolygonF &polygon)
void addRect (qreal x, qreal y, qreal w, qreal h)
void addRect (const QRectF &rect)
void addRegion (const QRegion &region)
void addRoundedRect (qreal x, qreal y, qreal w, qreal h, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void addRoundedRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void addRoundRect (qreal x, qreal y, qreal w, qreal h, int roundness)
void addRoundRect (const QRectF &rect, int roundness)
void addRoundRect (qreal x, qreal y, qreal w, qreal h, int xRnd, int yRnd)
void addRoundRect (const QRectF &rect, int xRnd, int yRnd)
void addText (qreal x, qreal y, const QFont &f, const QString &text)
void addText (const QPointF &point, const QFont &f, const QString &text)
qreal angleAtPercent (qreal t) const
void arcMoveTo (qreal x, qreal y, qreal w, qreal h, qreal angle)
void arcMoveTo (const QRectF &rect, qreal angle)
void arcTo (qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength)
void arcTo (const QRectF &rect, qreal startAngle, qreal arcLength)
QRectF boundingRect () const
void closeSubpath ()
void connectPath (const QPainterPath &path)
bool contains (const QPainterPath &p) const
bool contains (const QRectF &rect) const
bool contains (const QPointF &pt) const
QRectF controlPointRect () const
void cubicTo (qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
void cubicTo (const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
QPointF currentPosition () const
const QPainterPath::ElementelementAt (int i) const
int elementCount () const
Qt::FillRule fillRule () const
QPainterPath intersected (const QPainterPath &r) const
bool intersects (const QPainterPath &p) const
bool intersects (const QRectF &rect) const
bool isEmpty () const
qreal length () const
void lineTo (qreal x, qreal y)
void lineTo (const QPointF &p)
void moveTo (qreal x, qreal y)
void moveTo (const QPointF &p)
bool operator!= (const QPainterPath &other) const
QPainterPathoperator= (const QPainterPath &other)
bool operator== (const QPainterPath &other) const
qreal percentAtLength (qreal t) const
QPointF pointAtPercent (qreal t) const
 QPainterPath (const QPainterPath &other)
 QPainterPath (const QPointF &startPoint)
 QPainterPath ()
void quadTo (qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
void quadTo (const QPointF &ctrlPt, const QPointF &endPt)
void setElementPositionAt (int i, qreal x, qreal y)
void setFillRule (Qt::FillRule fillRule)
QPainterPath simplified () const
qreal slopeAtPercent (qreal t) const
QPainterPath subtracted (const QPainterPath &r) const
QPainterPath subtractedInverted (const QPainterPath &r) const
QPolygonF toFillPolygon (const QTransform &matrix) const
QPolygonF toFillPolygon (const QMatrix &matrix=QMatrix()) const
QList< QPolygonFtoFillPolygons (const QTransform &matrix) const
QList< QPolygonFtoFillPolygons (const QMatrix &matrix=QMatrix()) const
QPainterPath toReversed () const
QList< QPolygonFtoSubpathPolygons (const QTransform &matrix) const
QList< QPolygonFtoSubpathPolygons (const QMatrix &matrix=QMatrix()) const
QPainterPath united (const QPainterPath &r) const
 ~QPainterPath ()

Private Member Functions

void computeBoundingRect () const
void computeControlPointRect () const
QPainterPathData * d_func () const
void detach ()
void detach_helper ()
void ensureData ()
void ensureData_helper ()
void setDirty (bool)

Private Attributes

QPainterPathPrivate * d_ptr

Friends

Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &, const QPainterPath &)
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QPainterPath &)
class QMatrix
class QPainterPathData
class QPainterPathStroker
class QPainterPathStrokerPrivate
class QTransform

Classes

class  Element
 The QPainterPath::Element class specifies the position and type of a subpath. More...

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index