53 #include <private/qbezier_p.h>
54 #include <private/qfontengine_p.h>
55 #include <private/qnumeric_p.h>
56 #include <private/qobject_p.h>
57 #include <private/qpathclipper_p.h>
58 #include <private/qstroker_p.h>
59 #include <private/qtextengine_p.h>
64 #include <performance.h>
73 static inline bool isValidCoord(
qreal c)
75 if (
sizeof(
qreal) >=
sizeof(
double))
81 static bool hasValidCoords(
QPointF p)
83 return isValidCoord(
p.x()) && isValidCoord(
p.y());
86 static bool hasValidCoords(
QRectF r)
88 return isValidCoord(
r.x()) && isValidCoord(
r.y()) && isValidCoord(
r.width()) && isValidCoord(
r.height());
113 qreal h2 =
r.height() / 2;
118 for (
int i = 0;
i < 2; ++
i) {
125 int quadrant = int(
t);
139 if (quadrant == 1 || quadrant == 2)
143 if (quadrant == 0 || quadrant == 1)
153 const char *
names[] = {
160 printf(
"\nQPainterPath: elementCount=%d\n",
path.elementCount());
161 for (
int i=0;
i<
path.elementCount(); ++
i) {
164 printf(
" - %3d:: %s, (%.2f, %.2f)\n",
i,
names[
e.type],
e.x,
e.y);
489 return d_ptr ? d_ptr->elements.
size() : 0;
504 return d_ptr->elements.
at(
i);
559 d_func()->elements <<
e;
562 void QPainterPath::detach()
571 void QPainterPath::ensureData_helper()
647 if ((!
d &&
size > 0) || (
d &&
d->elements.capacity() <
size)) {
664 return d->elements.capacity();
683 printf(
"QPainterPath::closeSubpath()\n");
713 printf(
"QPainterPath::moveTo() (%.2f,%.2f)\n",
p.x(),
p.y());
716 if (!hasValidCoords(
p)) {
718 qWarning(
"QPainterPath::moveTo: Adding point with invalid coordinates, ignoring call");
729 d->require_moveTo =
false;
732 d->elements.last().x =
p.x();
733 d->elements.last().y =
p.y();
736 d->elements.append(elm);
738 d->cStart =
d->elements.size() - 1;
763 printf(
"QPainterPath::lineTo() (%.2f,%.2f)\n",
p.x(),
p.y());
766 if (!hasValidCoords(
p)) {
768 qWarning(
"QPainterPath::lineTo: Adding point with invalid coordinates, ignoring call");
779 if (
p ==
QPointF(
d->elements.constLast()))
782 d->elements.append(elm);
784 d->convex =
d->elements.size() == 3 || (
d->elements.size() == 4 &&
d->isClosed());
821 printf(
"QPainterPath::cubicTo() (%.2f,%.2f), (%.2f,%.2f), (%.2f,%.2f)\n",
822 c1.
x(), c1.
y(),
c2.x(),
c2.y(),
e.x(),
e.y());
825 if (!hasValidCoords(c1) || !hasValidCoords(
c2) || !hasValidCoords(
e)) {
827 qWarning(
"QPainterPath::cubicTo: Adding point with invalid coordinates, ignoring call");
841 if (
d->elements.constLast() == c1 && c1 ==
c2 &&
c2 ==
e)
849 d->elements << ce1 << ce2 << ee;
877 printf(
"QPainterPath::quadTo() (%.2f,%.2f), (%.2f,%.2f)\n",
878 c.x(),
c.y(),
e.x(),
e.y());
881 if (!hasValidCoords(
c) || !hasValidCoords(
e)) {
883 qWarning(
"QPainterPath::quadTo: Adding point with invalid coordinates, ignoring call");
898 if (prev ==
c &&
c ==
e)
901 QPointF c1((prev.
x() + 2*
c.x()) / 3, (prev.
y() + 2*
c.y()) / 3);
948 printf(
"QPainterPath::arcTo() (%.2f, %.2f, %.2f, %.2f, angle=%.2f, sweep=%.2f\n",
952 if (!hasValidCoords(
rect) || !isValidCoord(startAngle) || !isValidCoord(sweepLength)) {
954 qWarning(
"QPainterPath::arcTo: Adding point with invalid coordinates, ignoring call");
970 for (
int i=0;
i<point_count;
i+=3) {
972 pts[
i+1].
x(), pts[
i+1].
y(),
973 pts[
i+2].
x(), pts[
i+2].
y());
1021 return !d_ptr || d_func()->elements.
isEmpty()
1023 :
QPointF(d_func()->elements.constLast().x, d_func()->elements.constLast().y);
1057 if (!hasValidCoords(
r)) {
1059 qWarning(
"QPainterPath::addRect: Adding point with invalid coordinates, ignoring call");
1070 bool first = d_func()->elements.
size() < 2;
1079 d_func()->elements << l1 << l2 << l3 << l4;
1080 d_func()->require_moveTo =
true;
1081 d_func()->convex =
first;
1112 d_func()->elements << elm;
1139 qWarning(
"QPainterPath::addEllipse: Adding point with invalid coordinates, ignoring call");
1150 bool first = d_func()->elements.
size() < 2;
1157 cubicTo(pts[0], pts[1], pts[2]);
1158 cubicTo(pts[3], pts[4], pts[5]);
1159 cubicTo(pts[6], pts[7], pts[8]);
1160 cubicTo(pts[9], pts[10], pts[11]);
1161 d_func()->require_moveTo =
true;
1163 d_func()->convex =
first;
1193 layout.setCacheEnabled(
true);
1196 opt.setUseDesignMetrics(
true);
1215 for (
int i = 0;
i < nItems; ++
i)
1219 for (
int i = 0;
i < nItems; ++
i) {
1220 int item = visualOrder[
i];
1230 : QTextItem::RenderFlags{});
1233 if (
f.d->underline) {
1237 if (
f.d->overline) {
1241 if (
f.d->strikeOut) {
1260 if (
other.isEmpty())
1269 d->elements.remove(
d->elements.size()-1);
1272 int cStart =
d->elements.size() +
other.d_func()->cStart;
1273 d->elements +=
other.d_func()->elements;
1276 d->require_moveTo =
other.d_func()->isClosed();
1291 if (
other.isEmpty())
1300 d->elements.remove(
d->elements.size()-1);
1303 int cStart =
d->elements.size() +
other.d_func()->cStart;
1304 int first =
d->elements.size();
1305 d->elements +=
other.d_func()->elements;
1312 d->elements.remove(
first--);
1316 if (cStart !=
first)
1374 #define QT_BEZIER_A(bezier, coord) 3 * (-bezier.coord##1 \
1375 + 3*bezier.coord##2 \
1376 - 3*bezier.coord##3 \
1379 #define QT_BEZIER_B(bezier, coord) 6 * (bezier.coord##1 \
1380 - 2*bezier.coord##2 \
1383 #define QT_BEZIER_C(bezier, coord) 3 * (- bezier.coord##1 \
1386 #define QT_BEZIER_CHECK_T(bezier, t) \
1387 if (t >= 0 && t <= 1) { \
1388 QPointF p(b.pointAt(t)); \
1389 if (p.x() < minx) minx = p.x(); \
1390 else if (p.x() > maxx) maxx = p.x(); \
1391 if (p.y() < miny) miny = p.y(); \
1392 else if (p.y() > maxy) maxy = p.y(); \
1398 qreal minx, miny, maxx, maxy;
1431 const qreal tx = bx * bx - 4 * ax * cx;
1435 qreal rcp = 1 / (2 * ax);
1436 qreal t1 = (-bx + temp) * rcp;
1439 qreal t2 = (-bx - temp) * rcp;
1465 qreal rcp = 1 / (2 * ay);
1474 return QRectF(minx, miny, maxx - minx, maxy - miny);
1490 computeBoundingRect();
1510 if (
d->dirtyControlBounds)
1511 computeControlPointRect();
1512 return d->controlBounds;
1548 rev.
moveTo(
d->elements.at(
d->elements.size()-1).x,
d->elements.at(
d->elements.size()-1).y);
1550 for (
int i=
d->elements.size()-1;
i>=1; --
i) {
1605 if (current.
size() > 1)
1606 flatCurves += current;
1626 Q_ASSERT(!
"QPainterPath::toSubpathPolygons(), bad element type");
1631 if (current.
size()>1)
1632 flatCurves += current;
1673 bounds += subpaths.
at(
i).boundingRect();
1675 #ifdef QPP_FILLPOLYGONS_DEBUG
1676 printf(
"QPainterPath::toFillPolygons, subpathCount=%d\n",
count);
1677 for (
int i=0;
i<bounds.
size(); ++
i)
1686 if (subpaths.
at(
j).size() <= 2)
1696 #ifdef QPP_FILLPOLYGONS_DEBUG
1697 printf(
"Intersections before flattening:\n");
1700 for (
int j = 0;
j < isects[
i].
size(); ++
j) {
1701 printf(
"%d ", isects[
i][
j]);
1710 for (
int j=0;
j<current_isects.
size(); ++
j) {
1711 int isect_j = current_isects.
at(
j);
1715 for (
int k = 0,
size = isects_j.
size(); k <
size; ++k) {
1716 int isect_k = isects_j.
at(k);
1717 if (isect_k !=
i && !isects.
at(
i).contains(isect_k)) {
1718 isects[
i] += isect_k;
1721 isects[isect_j].
clear();
1725 #ifdef QPP_FILLPOLYGONS_DEBUG
1726 printf(
"Intersections after flattening:\n");
1729 for (
int j = 0;
j < isects[
i].
size(); ++
j) {
1730 printf(
"%d ", isects[
i][
j]);
1739 if (!subpath_list.
isEmpty()) {
1741 for (
int j=0;
j<subpath_list.
size(); ++
j) {
1745 buildUp += subpath.
first();
1757 static void qt_painterpath_isect_line(
const QPointF &
p1,
1773 }
else if (
y2 <
y1) {
1789 static void qt_painterpath_isect_curve(
const QBezier &bezier,
const QPointF &pt,
1790 int *winding,
int depth = 0)
1800 if (
y >= bounds.
y() &&
y < bounds.
y() + bounds.
height()) {
1805 if (
depth == 32 || (bounds.
width() < lower_bound && bounds.
height() < lower_bound)) {
1809 if (bezier.
pt1().
x() <=
x) {
1810 (*winding) += (bezier.
pt4().
y() > bezier.
pt1().
y() ? 1 : -1);
1816 const auto halves = bezier.
split();
1817 qt_painterpath_isect_curve(halves.first, pt, winding,
depth + 1);
1818 qt_painterpath_isect_curve(halves.second, pt, winding,
depth + 1);
1837 int winding_number = 0;
1841 for (
int i=0;
i<
d->elements.size(); ++
i) {
1848 qt_painterpath_isect_line(last_pt, last_start, pt, &winding_number);
1849 last_start = last_pt =
e;
1853 qt_painterpath_isect_line(last_pt,
e, pt, &winding_number);
1862 pt, &winding_number);
1874 if (last_pt != last_start)
1875 qt_painterpath_isect_line(last_pt, last_start, pt, &winding_number);
1878 ? (winding_number != 0)
1879 : ((winding_number % 2) != 0));
1970 if (
depth == 32 || (bounds.
width() < lower_bound && bounds.
height() < lower_bound))
1973 const auto halves = bezier.
split();
1974 if (qt_isect_curve_horizontal(halves.first,
y,
x1,
x2,
depth + 1)
1975 || qt_isect_curve_horizontal(halves.second,
y,
x1,
x2,
depth + 1))
1988 if (
depth == 32 || (bounds.
width() < lower_bound && bounds.
height() < lower_bound))
1991 const auto halves = bezier.
split();
1992 if (qt_isect_curve_vertical(halves.first,
x,
y1,
y2,
depth + 1)
1993 || qt_isect_curve_vertical(halves.second,
x,
y1,
y2,
depth + 1))
2001 if ((point.
x() ==
rect.left() || point.
x() ==
rect.right()) &&
2002 (point.
y() >=
rect.top() && point.
y() <=
rect.bottom()))
2004 if ((point.
y() ==
rect.top() || point.
y() ==
rect.bottom()) &&
2005 (point.
x() >=
rect.left() && point.
x() <=
rect.right()))
2017 enum { OnRect, InsideRect, OutsideRect} edgeStatus = OnRect;
2018 for (
int i=0;
i<
path->elementCount(); ++
i) {
2027 && qt_painterpath_isect_line_rect(last_pt.
x(), last_pt.
y(),
2028 last_start.
x(), last_start.
y(),
rect))
2030 last_start = last_pt =
e;
2034 if (qt_painterpath_isect_line_rect(last_pt.
x(), last_pt.
y(),
e.x,
e.y,
rect))
2044 if (qt_isect_curve_horizontal(bezier,
rect.top(),
rect.left(),
rect.right())
2045 || qt_isect_curve_horizontal(bezier,
rect.bottom(),
rect.left(),
rect.right())
2046 || qt_isect_curve_vertical(bezier,
rect.left(),
rect.top(),
rect.bottom())
2047 || qt_isect_curve_vertical(bezier,
rect.right(),
rect.top(),
rect.bottom()))
2058 if (!pointOnEdge(
rect, last_pt)) {
2059 bool contained =
rect.contains(last_pt);
2060 switch (edgeStatus) {
2070 edgeStatus = contained ? InsideRect : OutsideRect;
2074 if (last_pt == last_start)
2075 edgeStatus = OnRect;
2080 if (last_pt != last_start
2081 && qt_painterpath_isect_line_rect(last_pt.
x(), last_pt.
y(),
2082 last_start.
x(), last_start.
y(),
rect))
2121 if (qt_painterpath_check_crossing(
this,
rect))
2130 for (
int i=0;
i<
d->elements.size(); ++
i) {
2147 if (!d_ptr || (dx == 0 && dy == 0))
2150 int elementsLeft = d_ptr->elements.
size();
2151 if (elementsLeft <= 0)
2157 while (elementsLeft--) {
2215 if (qt_painterpath_check_crossing(
this,
rect)) {
2242 for (
int i=0;
i<
d->elements.size(); ++
i) {
2249 for (; !stop &&
i<
d->elements.size(); ++
i) {
2298 }
else if (!
d || !other_d) {
2305 else if (
d->fillRule != other_d->fillRule)
2307 else if (
d->elements.size() != other_d->elements.
size())
2313 epsilon.rwidth() *= qt_epsilon;
2314 epsilon.rheight() *= qt_epsilon;
2316 for (
int i = 0;
i <
d->elements.size(); ++
i)
2317 if (
d->elements.at(
i).type != other_d->elements.
at(
i).
type
2318 || !epsilonCompare(
d->elements.at(
i), other_d->elements.
at(
i),
epsilon))
2335 return !(*
this==
path);
2396 return *
this = (*
this &
other);
2408 return *
this = (*
this |
other);
2421 return *
this = (*
this +
other);
2434 return *
this = (*
this -
other);
2437 #ifndef QT_NO_DATASTREAM
2454 s <<
p.elementCount();
2455 for (
int i=0;
i <
p.d_func()->elements.size(); ++
i) {
2458 s << double(
e.x) << double(
e.y);
2460 s <<
p.d_func()->cStart;
2461 s << int(
p.d_func()->fillRule);
2476 bool errorDetected =
false;
2484 if (
p.d_func()->elements.size() == 1) {
2486 p.d_func()->elements.clear();
2495 if (!isValidCoord(
qreal(
x)) || !isValidCoord(
qreal(
y))) {
2497 qWarning(
"QDataStream::operator>>: Invalid QPainterPath coordinates read, skipping it");
2499 errorDetected =
true;
2503 p.d_func()->elements.append(elm);
2505 s >>
p.d_func()->cStart;
2510 p.d_func()->dirtyBounds =
true;
2511 p.d_func()->dirtyControlBounds =
true;
2657 if (
d->dashPattern.isEmpty()) {
2700 d_func()->stroker.setCapStyle(
style);
2709 return d_func()->stroker.capStyle();
2717 d_func()->stroker.setJoinStyle(
style);
2725 return d_func()->stroker.joinStyle();
2800 d_func()->dashPattern.clear();
2810 return d_func()->dashPattern;
2818 return d_func()->dashOffset;
2829 d_func()->dashOffset =
offset;
2854 for (
int i=0;
i<flats.
size(); ++
i) {
2856 if (!flats.
at(
i).isClosed())
2867 return 3*
t*
t*(
d - 3*
c + 3*
b -
a) + 6*
t*(
c - 2*
b +
a) + 3*(
b -
a);
2880 for (
int i=1;
i<
d->elements.size(); ++
i) {
2895 d->elements.at(
i+1),
2896 d->elements.at(
i+2));
2923 if (
len > totalLength)
2927 for (
int i=1;
i<
d->elements.size(); ++
i) {
2938 if (curLen >=
len) {
2939 return len/totalLength ;
2948 d->elements.at(
i+1),
2949 d->elements.at(
i+2));
2951 qreal prevLen = curLen;
2954 if (curLen >=
len) {
2956 return (
res * blen + prevLen)/totalLength;
2972 *startingLength = 0;
2979 const int lastElement =
path.elementCount() - 1;
2980 for (
int i=0;
i <= lastElement; ++
i) {
2991 if (
i == lastElement || curLen/totalLength >=
t) {
2992 *bezierLength = llen;
3003 path.elementAt(
i+1),
3004 path.elementAt(
i+2));
3008 if (
i + 2 == lastElement || curLen/totalLength >=
t) {
3009 *bezierLength = blen;
3019 *startingLength = curLen;
3036 qWarning(
"QPainterPath::pointAtPercent accepts only values between 0 and 1");
3040 if (!d_ptr || d_ptr->elements.
size() == 0)
3043 if (d_ptr->elements.
size() == 1)
3044 return d_ptr->elements.
at(0);
3048 qreal bezierLen = 0;
3049 QBezier b = bezierAtT(*
this,
t, &curLen, &bezierLen);
3050 qreal realT = (totalLength *
t - curLen) / bezierLen;
3052 return b.pointAt(qBound(
qreal(0), realT,
qreal(1)));
3070 qWarning(
"QPainterPath::angleAtPercent accepts only values between 0 and 1");
3076 qreal bezierLen = 0;
3077 QBezier bez = bezierAtT(*
this,
t, &curLen, &bezierLen);
3078 qreal realT = (totalLength *
t - curLen) / bezierLen;
3099 qWarning(
"QPainterPath::slopeAtPercent accepts only values between 0 and 1");
3105 qreal bezierLen = 0;
3106 QBezier bez = bezierAtT(*
this,
t, &curLen, &bezierLen);
3107 qreal realT = (totalLength *
t - curLen) / bezierLen;
3117 if (std::numeric_limits<qreal>::has_infinity) {
3118 slope = (m2 < 0) ? -std::numeric_limits<qreal>::infinity()
3119 : std::numeric_limits<qreal>::infinity();
3121 if (
sizeof(
qreal) ==
sizeof(
double)) {
3122 return 1.79769313486231570e+308;
3124 return ((
qreal)3.40282346638528860e+38);
3160 xRadius = 100 * qMin(xRadius,
w) /
w;
3165 yRadius = 100 * qMin(yRadius,
h) /
h;
3175 if (xRadius <= 0 || yRadius <= 0) {
3184 qreal rxx2 =
w*xRadius/100;
3185 qreal ryy2 =
h*yRadius/100;
3190 bool first = d_func()->elements.
size() < 2;
3193 arcTo(
x,
y, rxx2, ryy2, 180, -90);
3194 arcTo(
x+
w-rxx2,
y, rxx2, ryy2, 90, -90);
3195 arcTo(
x+
w-rxx2,
y+
h-ryy2, rxx2, ryy2, 0, -90);
3196 arcTo(
x,
y+
h-ryy2, rxx2, ryy2, 270, -90);
3199 d_func()->require_moveTo =
true;
3200 d_func()->convex =
first;
3294 if (
p.elementCount() == 1)
3316 if (
p.elementCount() == 1)
3324 void QPainterPath::setDirty(
bool dirty)
3326 d_func()->dirtyBounds = dirty;
3327 d_func()->dirtyControlBounds = dirty;
3328 d_func()->pathConverter.reset();
3329 d_func()->convex =
false;
3332 void QPainterPath::computeBoundingRect()
const
3335 d->dirtyBounds =
false;
3341 qreal minx, maxx, miny, maxy;
3342 minx = maxx =
d->elements.at(0).x;
3343 miny = maxy =
d->elements.at(0).y;
3344 for (
int i=1;
i<
d->elements.size(); ++
i) {
3345 const Element &
e =
d->elements.at(
i);
3350 if (
e.x > maxx) maxx =
e.x;
3351 else if (
e.x < minx) minx =
e.x;
3352 if (
e.y > maxy) maxy =
e.y;
3353 else if (
e.y < miny) miny =
e.y;
3359 d->elements.at(
i+1),
3360 d->elements.at(
i+2));
3361 QRectF r = qt_painterpath_bezier_extrema(
b);
3364 if (
r.x() < minx) minx =
r.x();
3366 if (
r.y() < miny) miny =
r.y();
3375 d->bounds =
QRectF(minx, miny, maxx - minx, maxy - miny);
3379 void QPainterPath::computeControlPointRect()
const
3382 d->dirtyControlBounds =
false;
3384 d->controlBounds =
QRect();
3388 qreal minx, maxx, miny, maxy;
3389 minx = maxx =
d->elements.at(0).x;
3390 miny = maxy =
d->elements.at(0).y;
3391 for (
int i=1;
i<
d->elements.size(); ++
i) {
3392 const Element &
e =
d->elements.at(
i);
3393 if (
e.x > maxx) maxx =
e.x;
3394 else if (
e.x < minx) minx =
e.x;
3395 if (
e.y > maxy) maxy =
e.y;
3396 else if (
e.y < miny) miny =
e.y;
3398 d->controlBounds =
QRectF(minx, miny, maxx - minx, maxy - miny);
3401 #ifndef QT_NO_DEBUG_STREAM
3404 s.nospace() <<
"QPainterPath: Element count=" <<
p.elementCount() <<
Qt::endl;
3405 const char *
types[] = {
"MoveTo",
"LineTo",
"CurveTo",
"CurveToData"};
3406 for (
int i=0;
i<
p.elementCount(); ++
i) {
3407 s.nospace() <<
" -> " <<
types[
p.elementAt(
i).type] <<
"(x=" <<
p.elementAt(
i).x <<
", y=" <<
p.elementAt(
i).y <<
')' <<
Qt::endl;
small capitals from c petite p scientific i
[1]
static QBezier fromPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
std::pair< QBezier, QBezier > split() const
static void coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal &d)
void addToPolygon(QPolygonF *p, qreal bezier_flattening_threshold=0.5) const
void setDashPattern(const QList< qfixed > &dashPattern)
void setDashOffset(qreal offset)
static QList< qfixed > patternForStyle(Qt::PenStyle style)
The QDataStream class provides serialization of binary data to a QIODevice.
operator>>(QDataStream &ds, qfloat16 &f)
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
void reset(T *ptr=nullptr) noexcept
virtual QFixed ascent() const
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual QFixed lineThickness() const
virtual QFixed underlinePosition() const
The QFont class specifies a query for a font used for drawing text.
The QLineF class provides a two-dimensional vector using floating point precision.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const T & constFirst() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void resize(qsizetype size)
void append(parameter_type t)
bool qFuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2)
The QPainterPath::Element class specifies the position and type of a subpath.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
void quadTo(const QPointF &ctrlPt, const QPointF &endPt)
QPainterPath operator-(const QPainterPath &other) const
QPainterPath translated(qreal dx, qreal dy) const
void translate(qreal dx, qreal dy)
void addRect(const QRectF &rect)
QList< QPolygonF > toSubpathPolygons(const QTransform &matrix=QTransform()) const
void moveTo(const QPointF &p)
void addEllipse(const QRectF &rect)
qreal angleAtPercent(qreal t) const
void setFillRule(Qt::FillRule fillRule)
void setElementPositionAt(int i, qreal x, qreal y)
QPainterPath subtracted(const QPainterPath &r) const
QPainterPath & operator=(const QPainterPath &other)
QPainterPath operator+(const QPainterPath &other) const
QPainterPath::Element elementAt(int i) const
void connectPath(const QPainterPath &path)
void addPolygon(const QPolygonF &polygon)
QPainterPath & operator&=(const QPainterPath &other)
QPainterPath simplified() const
void addPath(const QPainterPath &path)
QPolygonF toFillPolygon(const QTransform &matrix=QTransform()) const
QRectF controlPointRect() const
QPainterPath & operator|=(const QPainterPath &other)
bool intersects(const QRectF &rect) const
QList< QPolygonF > toFillPolygons(const QTransform &matrix=QTransform()) const
QRectF boundingRect() const
bool contains(const QPointF &pt) const
bool operator!=(const QPainterPath &other) const
Qt::FillRule fillRule() const
QPointF pointAtPercent(qreal t) const
QPainterPath united(const QPainterPath &r) const
void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
QPainterPath & operator-=(const QPainterPath &other)
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength)
QPainterPath operator|(const QPainterPath &other) const
bool operator==(const QPainterPath &other) const
QPainterPath intersected(const QPainterPath &r) const
qreal percentAtLength(qreal t) const
QPainterPath toReversed() const
QPainterPath & operator+=(const QPainterPath &other)
qreal slopeAtPercent(qreal t) const
void addText(const QPointF &point, const QFont &f, const QString &text)
void lineTo(const QPointF &p)
QPointF currentPosition() const
void swap(QPainterPath &other) noexcept
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
void addRegion(const QRegion ®ion)
QPainterPath operator&(const QPainterPath &other) const
void arcMoveTo(const QRectF &rect, qreal angle)
The QPainterPathStroker class is used to generate fillable outlines for a given painter path.
void setCurveThreshold(qreal threshold)
Qt::PenJoinStyle joinStyle() const
QList< qreal > dashPattern() const
void setDashPattern(Qt::PenStyle)
qreal curveThreshold() const
Qt::PenCapStyle capStyle() const
void setDashOffset(qreal offset)
void setCapStyle(Qt::PenCapStyle style)
void setWidth(qreal width)
QPainterPath createStroke(const QPainterPath &path) const
void setJoinStyle(Qt::PenJoinStyle style)
void setMiterLimit(qreal length)
QPainterPathStrokerPrivate()
QPainterPath clip(Operation op=BoolAnd)
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QList< qreal > dashPattern() const
Qt::PenCapStyle capStyle() const
Qt::PenJoinStyle joinStyle() const
Qt::PenStyle style() const
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr qreal bottom() const noexcept
constexpr qreal y() const noexcept
constexpr qreal height() const noexcept
constexpr qreal width() const noexcept
constexpr qreal left() const noexcept
bool intersects(const QRectF &r) const noexcept
constexpr bool isNull() const noexcept
constexpr QSizeF size() const noexcept
constexpr qreal top() const noexcept
constexpr qreal right() const noexcept
The QRect class defines a rectangle in the plane using integer precision.
The QRegion class specifies a clip region for a painter.
The QSizeF class defines the size of a two-dimensional object using floating point precision.
The QString class provides a Unicode character string.
void setCubicToHook(qStrokerCubicToHook cubicToHook)
void setMoveToHook(qStrokerMoveToHook moveToHook)
void strokePath(const QPainterPath &path, void *data, const QTransform &matrix)
void setLineToHook(qStrokerLineToHook lineToHook)
void setClipRect(const QRectF &clip)
QGlyphLayout shapedGlyphs(const QScriptItem *si) const
QFontEngine * fontEngine(const QScriptItem &si, QFixed *ascent=nullptr, QFixed *descent=nullptr, QFixed *leading=nullptr) const
static void bidiReorder(int numRuns, const quint8 *levels, int *visualOrder)
The QTextLayout class is used to lay out and render text. \inmodule QtGui.
The QTextLine class represents a line of text inside a QTextLayout. \inmodule QtGui.
The QTextOption class provides a description of general rich text properties. \inmodule QtGui.
QTextStream & endl(QTextStream &stream)
bool qIsFinite(qfloat16 f) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
GLenum GLuint GLenum GLsizei length
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
GLfixed GLfixed GLfixed y2
GLsizei const GLchar *const * path
void qt_path_stroke_move_to(qfixed x, qfixed y, void *data)
#define QT_BEZIER_CHECK_T(bezier, t)
#define QT_BEZIER_C(bezier, coord)
void qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length, QPointF *startPoint, QPointF *endPoint)
void qt_path_stroke_cubic_to(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
#define QT_BEZIER_A(bezier, coord)
#define QT_BEZIER_B(bezier, coord)
QPainterPath qt_stroke_dash(const QPainterPath &path, qreal *dashes, int dashCount)
void qt_path_stroke_line_to(qfixed x, qfixed y, void *data)
qreal qt_t_for_arc_angle(qreal angle)
QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLength, QPointF *curves, int *point_count)
#define qt_fixed_to_real(fixed)
#define qt_real_to_fixed(real)
QT_BEGIN_NAMESPACE typedef qreal qfixed
constexpr qreal toReal() const