- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Friends

# QPainterPath Class Reference

Search for all occurrences

## Detailed Description

Definition at line 67 of file qpainterpath.h.

`#include <qpainterpath.h>`

List of all members.

## Classes
class | Element
## Public Types
enum | ElementType { MoveToElement, LineToElement, CurveToElement, CurveToDataElement }
## Public Member Functions
| QPainterPath ()
| QPainterPath (const QPointF &startPoint)
| QPainterPath (const QPainterPath &other)
QPainterPath & | operator= (const QPainterPath &other)
| ~QPainterPath ()
void | closeSubpath ()
void | moveTo (const QPointF &p)
void | moveTo (qreal x, qreal y)
void | lineTo (const QPointF &p)
void | lineTo (qreal x, qreal y)
void | arcMoveTo (const QRectF &rect, qreal angle)
void | arcMoveTo (qreal x, qreal y, qreal w, qreal h, qreal angle)
void | arcTo (const QRectF &rect, qreal startAngle, qreal arcLength)
void | arcTo (qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength)
void | cubicTo (const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
void | cubicTo (qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
void | quadTo (const QPointF &ctrlPt, const QPointF &endPt)
void | quadTo (qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
QPointF | currentPosition () const
void | addRect (const QRectF &rect)
void | addRect (qreal x, qreal y, qreal w, qreal h)
void | addEllipse (const QRectF &rect)
void | addEllipse (qreal x, qreal y, qreal w, qreal h)
void | addEllipse (const QPointF &center, qreal rx, qreal ry)
void | addPolygon (const QPolygonF &polygon)
void | addText (const QPointF &point, const QFont &f, const QString &text)
void | addText (qreal x, qreal y, const QFont &f, const QString &text)
void | addPath (const QPainterPath &path)
void | addRegion (const QRegion &region)
void | addRoundedRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void | addRoundedRect (qreal x, qreal y, qreal w, qreal h, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void | addRoundRect (const QRectF &rect, int xRnd, int yRnd)
void | addRoundRect (qreal x, qreal y, qreal w, qreal h, int xRnd, int yRnd)
void | addRoundRect (const QRectF &rect, int roundness)
void | addRoundRect (qreal x, qreal y, qreal w, qreal h, int roundness)
void | connectPath (const QPainterPath &path)
bool | contains (const QPointF &pt) const
bool | contains (const QRectF &rect) const
bool | intersects (const QRectF &rect) const
void | translate (qreal dx, qreal dy)
void | translate (const QPointF &offset)
QPainterPath | translated (qreal dx, qreal dy) const
QPainterPath | translated (const QPointF &offset) const
QRectF | boundingRect () const
QRectF | controlPointRect () const
Qt::FillRule | fillRule () const
void | setFillRule (Qt::FillRule fillRule)
bool | isEmpty () const
QPainterPath | toReversed () const
QList< QPolygonF > | toSubpathPolygons (const QMatrix &matrix=QMatrix()) const
QList< QPolygonF > | toFillPolygons (const QMatrix &matrix=QMatrix()) const
QPolygonF | toFillPolygon (const QMatrix &matrix=QMatrix()) const
QList< QPolygonF > | toSubpathPolygons (const QTransform &matrix) const
QList< QPolygonF > | toFillPolygons (const QTransform &matrix) const
QPolygonF | toFillPolygon (const QTransform &matrix) const
int | elementCount () const
const QPainterPath::Element & | elementAt (int i) const
void | setElementPositionAt (int i, qreal x, qreal y)
qreal | length () const
qreal | percentAtLength (qreal t) const
QPointF | pointAtPercent (qreal t) const
qreal | angleAtPercent (qreal t) const
qreal | slopeAtPercent (qreal t) const
bool | intersects (const QPainterPath &p) const
bool | contains (const QPainterPath &p) const
QPainterPath | united (const QPainterPath &r) const
QPainterPath | intersected (const QPainterPath &r) const
QPainterPath | subtracted (const QPainterPath &r) const
QPainterPath | subtractedInverted (const QPainterPath &r) const
QPainterPath | simplified () const
bool | operator== (const QPainterPath &other) const
bool | operator!= (const QPainterPath &other) const
QPainterPath | operator& (const QPainterPath &other) const
QPainterPath | operator| (const QPainterPath &other) const
QPainterPath | operator+ (const QPainterPath &other) const
QPainterPath | operator- (const QPainterPath &other) const
QPainterPath & | operator&= (const QPainterPath &other)
QPainterPath & | operator|= (const QPainterPath &other)
QPainterPath & | operator+= (const QPainterPath &other)
QPainterPath & | operator-= (const QPainterPath &other)
## Friends
class | QPainterPathData
class | QPainterPathStroker
class | QPainterPathStrokerPrivate
class | QMatrix
class | QTransform
class | QVectorPath
Q_GUI_EXPORT const QVectorPath & | qtVectorPathForPath (const QPainterPath &)
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QPainterPath &)
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QPainterPath &)

## Member Enumeration Documentation

enum ElementType

Search for all occurrences

Enumerator:

  MoveToElement | Search for all occurrences
  LineToElement | Search for all occurrences
  CurveToElement | Search for all occurrences
  CurveToDataElement | Search for all occurrences

Definition at line 70 of file qpainterpath.h.

                         {
            MoveToElement,
            LineToElement,
            CurveToElement,
            CurveToDataElement
        };

## Constructor & Destructor Documentation

QPainterPath | ( |  | ) |

QPainterPath | ( | const QPointF & | startPoint | ) | `[explicit]`

QPainterPath | ( | const QPainterPath & | other | ) |

~QPainterPath | ( |  | ) |

## Member Function Documentation

QPainterPath& operator= | ( | const QPainterPath & | other | ) |

void closeSubpath | ( |  | ) |

Search for all occurrences

void moveTo | ( | const QPointF & | p | ) |

Search for all occurrences

void moveTo | ( | qreal | x,
|  | qreal | y
| ) |  | `[inline]`

Search for all occurrences

Definition at line 298 of file qpainterpath.h.

    {
        moveTo(QPointF(x, y));
    }

void lineTo | ( | const QPointF & | p | ) |

Search for all occurrences

void lineTo | ( | qreal | x,
|  | qreal | y
| ) |  | `[inline]`

Search for all occurrences

Definition at line 303 of file qpainterpath.h.

    {
        lineTo(QPointF(x, y));
    }

void arcMoveTo | ( | const QRectF & | rect,
|  | qreal | angle
| ) |  |

Search for all occurrences

void arcMoveTo | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h,
|  | qreal | angle
| ) |  | `[inline]`

Search for all occurrences

Definition at line 313 of file qpainterpath.h.

    {
        arcMoveTo(QRectF(x, y, w, h), angle);
    }

void arcTo | ( | const QRectF & | rect,
|  | qreal | startAngle,
|  | qreal | arcLength
| ) |  |

Search for all occurrences

void arcTo | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h,
|  | qreal | startAngle,
|  | qreal | arcLength
| ) |  | `[inline]`

Search for all occurrences

Definition at line 308 of file qpainterpath.h.

    {
        arcTo(QRectF(x, y, w, h), startAngle, arcLength);
    }

void cubicTo | ( | const QPointF & | ctrlPt1,
|  | const QPointF & | ctrlPt2,
|  | const QPointF & | endPt
| ) |  |

Search for all occurrences

void cubicTo | ( | qreal | ctrlPt1x,
|  | qreal | ctrlPt1y,
|  | qreal | ctrlPt2x,
|  | qreal | ctrlPt2y,
|  | qreal | endPtx,
|  | qreal | endPty
| ) |  | `[inline]`

Search for all occurrences

Definition at line 318 of file qpainterpath.h.

    {
        cubicTo(QPointF(ctrlPt1x, ctrlPt1y), QPointF(ctrlPt2x, ctrlPt2y),
                QPointF(endPtx, endPty));
    }

void quadTo | ( | const QPointF & | ctrlPt,
|  | const QPointF & | endPt
| ) |  |

Search for all occurrences

void quadTo | ( | qreal | ctrlPtx,
|  | qreal | ctrlPty,
|  | qreal | endPtx,
|  | qreal | endPty
| ) |  | `[inline]`

Search for all occurrences

Definition at line 325 of file qpainterpath.h.

    {
        quadTo(QPointF(ctrlPtx, ctrlPty), QPointF(endPtx, endPty));
    }

QPointF currentPosition | ( |  | ) | const

Search for all occurrences

void addRect | ( | const QRectF & | rect | ) |

Search for all occurrences

void addRect | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h
| ) |  | `[inline]`

Search for all occurrences

Definition at line 340 of file qpainterpath.h.

    {
        addRect(QRectF(x, y, w, h));
    }

void addEllipse | ( | const QRectF & | rect | ) |

Search for all occurrences

void addEllipse | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h
| ) |  | `[inline]`

Search for all occurrences

Definition at line 330 of file qpainterpath.h.

    {
        addEllipse(QRectF(x, y, w, h));
    }

void addEllipse | ( | const QPointF & | center,
|  | qreal | rx,
|  | qreal | ry
| ) |  | `[inline]`

Search for all occurrences

Definition at line 335 of file qpainterpath.h.

    {
        addEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
    }

void addPolygon | ( | const QPolygonF & | polygon | ) |

Search for all occurrences

void addText | ( | const QPointF & | point,
|  | const QFont & | f,
|  | const QString & | text
| ) |  |

Search for all occurrences

void addText | ( | qreal | x,
|  | qreal | y,
|  | const QFont & | f,
|  | const QString & | text
| ) |  | `[inline]`

Search for all occurrences

Definition at line 376 of file qpainterpath.h.

    {
        addText(QPointF(x, y), f, text);
    }

void addPath | ( | const QPainterPath & | path | ) |

Search for all occurrences

void addRegion | ( | const QRegion & | region | ) |

Search for all occurrences

void addRoundedRect | ( | const QRectF & | rect,
|  | qreal | xRadius,
|  | qreal | yRadius,
|  | Qt::SizeMode | mode = `Qt::AbsoluteSize`
| ) |  |

Search for all occurrences

void addRoundedRect | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h,
|  | qreal | xRadius,
|  | qreal | yRadius,
|  | Qt::SizeMode | mode = `Qt::AbsoluteSize`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 345 of file qpainterpath.h.

    {
        addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
    }

void addRoundRect | ( | const QRectF & | rect,
|  | int | xRnd,
|  | int | yRnd
| ) |  |

Search for all occurrences

void addRoundRect | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h,
|  | int | xRnd,
|  | int | yRnd
| ) |  | `[inline]`

Search for all occurrences

Definition at line 352 of file qpainterpath.h.

    {
        addRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
    }

void addRoundRect | ( | const QRectF & | rect,
|  | int | roundness
| ) |  | `[inline]`

Search for all occurrences

Definition at line 358 of file qpainterpath.h.

    {
        int xRnd = roundness;
        int yRnd = roundness;
        if (rect.width() > rect.height())
            xRnd = int(roundness * rect.height()/rect.width());
        else
            yRnd = int(roundness * rect.width()/rect.height());
        addRoundRect(rect, xRnd, yRnd);
    }

void addRoundRect | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h,
|  | int | roundness
| ) |  | `[inline]`

Search for all occurrences

Definition at line 370 of file qpainterpath.h.

    {
        addRoundRect(QRectF(x, y, w, h), roundness);
    }

void connectPath | ( | const QPainterPath & | path | ) |

Search for all occurrences

bool contains | ( | const QPointF & | pt | ) | const

Search for all occurrences

bool contains | ( | const QRectF & | rect | ) | const

Search for all occurrences

bool intersects | ( | const QRectF & | rect | ) | const

Search for all occurrences

void translate | ( | qreal | dx,
|  | qreal | dy
| ) |  |

Search for all occurrences

void translate | ( | const QPointF & | offset | ) | `[inline]`

Search for all occurrences

Definition at line 381 of file qpainterpath.h.

    { translate(offset.x(), offset.y()); }

QPainterPath translated | ( | qreal | dx,
|  | qreal | dy
| ) |  | const

Search for all occurrences

QPainterPath translated | ( | const QPointF & | offset | ) | const `[inline]`

Search for all occurrences

Definition at line 384 of file qpainterpath.h.

    { return translated(offset.x(), offset.y()); }

QRectF boundingRect | ( |  | ) | const

Search for all occurrences

QRectF controlPointRect | ( |  | ) | const

Search for all occurrences

Qt::FillRule fillRule | ( |  | ) | const

Search for all occurrences

void setFillRule | ( | Qt::FillRule | fillRule | ) |

Search for all occurrences

bool isEmpty | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 387 of file qpainterpath.h.

    {
        return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement);
    }

QPainterPath toReversed | ( |  | ) | const

Search for all occurrences

QList<QPolygonF> toSubpathPolygons | ( | const QMatrix & | matrix = `QMatrix()` | ) | const

Search for all occurrences

QList<QPolygonF> toFillPolygons | ( | const QMatrix & | matrix = `QMatrix()` | ) | const

Search for all occurrences

QPolygonF toFillPolygon | ( | const QMatrix & | matrix = `QMatrix()` | ) | const

Search for all occurrences

QList<QPolygonF> toSubpathPolygons | ( | const QTransform & | matrix | ) | const

Search for all occurrences

QList<QPolygonF> toFillPolygons | ( | const QTransform & | matrix | ) | const

Search for all occurrences

QPolygonF toFillPolygon | ( | const QTransform & | matrix | ) | const

Search for all occurrences

int elementCount | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 392 of file qpainterpath.h.

    {
        return d_ptr ? d_ptr->elements.size() : 0;
    }

const QPainterPath::Element & elementAt | ( | int | i | ) | const `[inline]`

Search for all occurrences

Definition at line 397 of file qpainterpath.h.

    {
        Q_ASSERT(d_ptr);
        Q_ASSERT(i >= 0 && i < elementCount());
        return d_ptr->elements.at(i);
    }

void setElementPositionAt | ( | int | i,
|  | qreal | x,
|  | qreal | y
| ) |  | `[inline]`

Search for all occurrences

Definition at line 404 of file qpainterpath.h.

    {
        Q_ASSERT(d_ptr);
        Q_ASSERT(i >= 0 && i < elementCount());
        detach();
        QPainterPath::Element &e = d_ptr->elements[i];
        e.x = x;
        e.y = y;
    }

qreal length | ( |  | ) | const

Search for all occurrences

qreal percentAtLength | ( | qreal | t | ) | const

Search for all occurrences

QPointF pointAtPercent | ( | qreal | t | ) | const

Search for all occurrences

qreal angleAtPercent | ( | qreal | t | ) | const

Search for all occurrences

qreal slopeAtPercent | ( | qreal | t | ) | const

Search for all occurrences

bool intersects | ( | const QPainterPath & | p | ) | const

Search for all occurrences

bool contains | ( | const QPainterPath & | p | ) | const

Search for all occurrences

QPainterPath united | ( | const QPainterPath & | r | ) | const

Search for all occurrences

QPainterPath intersected | ( | const QPainterPath & | r | ) | const

Search for all occurrences

QPainterPath subtracted | ( | const QPainterPath & | r | ) | const

Search for all occurrences

QPainterPath subtractedInverted | ( | const QPainterPath & | r | ) | const

Search for all occurrences

QPainterPath simplified | ( |  | ) | const

Search for all occurrences

bool operator== | ( | const QPainterPath & | other | ) | const

bool operator!= | ( | const QPainterPath & | other | ) | const

QPainterPath operator& | ( | const QPainterPath & | other | ) | const

QPainterPath operator| | ( | const QPainterPath & | other | ) | const

QPainterPath operator+ | ( | const QPainterPath & | other | ) | const

QPainterPath operator- | ( | const QPainterPath & | other | ) | const

QPainterPath& operator&= | ( | const QPainterPath & | other | ) |

QPainterPath& operator|= | ( | const QPainterPath & | other | ) |

QPainterPath& operator+= | ( | const QPainterPath & | other | ) |

QPainterPath& operator-= | ( | const QPainterPath & | other | ) |

## Friends And Related Function Documentation

friend class QPainterPathData `[friend]`

Search for all occurrences

Definition at line 218 of file qpainterpath.h.

friend class QPainterPathStroker `[friend]`

Search for all occurrences

Definition at line 219 of file qpainterpath.h.

friend class QPainterPathStrokerPrivate `[friend]`

Search for all occurrences

Definition at line 220 of file qpainterpath.h.

friend class QMatrix `[friend]`

Search for all occurrences

Definition at line 221 of file qpainterpath.h.

friend class QTransform `[friend]`

Search for all occurrences

Definition at line 222 of file qpainterpath.h.

friend class QVectorPath `[friend]`

Search for all occurrences

Definition at line 223 of file qpainterpath.h.

Q_GUI_EXPORT const QVectorPath& qtVectorPathForPath | ( | const QPainterPath & |  | ) | `[friend]`

Search for all occurrences

Q_GUI_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QPainterPath & |
| ) |  | `[friend]`

Q_GUI_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QPainterPath & |
| ) |  | `[friend]`

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

- QtGui/qpainterpath.h

QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath
QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath QPainterPath