27#include <qpa/qplatformtheme.h>
28#include <qpa/qplatformintegration.h>
30#include <private/qfontengine_p.h>
31#include <private/qpaintengine_p.h>
32#include <private/qemulationpaintengine_p.h>
33#include <private/qpainterpath_p.h>
34#include <private/qtextengine_p.h>
35#include <private/qpaintengine_raster_p.h>
36#include <private/qmath_p.h>
37#include <private/qstatictext_p.h>
38#include <private/qglyphrun_p.h>
39#include <private/qhexstring_p.h>
40#include <private/qguiapplication_p.h>
41#include <private/qrawfont_p.h>
42#include <private/qfont_p.h>
51#define QGradient_StretchToDevice 0x10000000
52#define QPaintEngine_OpaqueBackground 0x40000000
56bool qt_show_painter_debug_output =
true;
63 int tabstops,
int* tabarray,
int tabarraylen,
71 const QPointF &decorationPosition,
82 switch (
brush.style()) {
86 return brush.gradient()->coordinateMode();
100 return brush.texture().isQBitmap() ||
brush.texture().hasAlphaChannel();
145 qWarning(
"QPainter: It is not safe to use %s outside the GUI thread", what);
174 bool doEmulation =
false;
249 ++
sp->d_ptr->refcount;
250 sp->d_ptr->d_ptrs.push_back(
q->d_ptr.get());
252 q->d_ptr.reset(
sp->d_ptr.get());
257 q->d_ptr->initFrom(pdev);
260 offset +=
q->d_ptr->engine->coordinateOffset();
263 q->d_ptr->state->ww =
q->d_ptr->state->vw = pdev->
width();
264 q->d_ptr->state->wh =
q->d_ptr->state->vh = pdev->
height();
267 if (
q->d_ptr->state->WxF) {
268 q->d_ptr->state->redirectionMatrix =
q->d_ptr->state->matrix;
269 q->d_ptr->state->redirectionMatrix *=
q->d_ptr->hidpiScaleTransform().inverted();
270 q->d_ptr->state->redirectionMatrix.translate(-
offset.x(), -
offset.y());
272 q->d_ptr->state->WxF =
false;
276 q->d_ptr->updateMatrix();
302 }
else if (!original) {
308 q->d_ptr.reset(original);
320 if (qt_show_painter_debug_output) {
321 printf(
"QPainter::drawHelper\n");
328 QPaintEngine::PaintEngineFeatures gradientStretch =
332 const bool mustEmulateObjectBoundingModeGradients =
extended
336 if (!(
state->emulationSpecifier & ~gradientStretch)
337 && !mustEmulateObjectBoundingModeGradients) {
347 qreal strokeOffsetX = 0, strokeOffsetY = 0;
368 strokeOffsetX =
qAbs(penWidth *
state->matrix.m11() / 2.0);
369 strokeOffsetY =
qAbs(penWidth *
state->matrix.m22() / 2.0);
378 absPathRect = pathBounds.
adjusted(-strokeOffsetX, -strokeOffsetY, strokeOffsetX, strokeOffsetY)
382 if (
q->hasClipping()) {
383 bool hasPerspectiveTransform =
false;
386 hasPerspectiveTransform =
true;
391 if (!hasPerspectiveTransform) {
398 bool old_txinv =
txinv;
404 absPathRect =
r.toAlignedRect();
416 if (absPathRect.
width() <= 0 || absPathRect.
height() <= 0)
426 p.setOpacity(
state->opacity);
427 p.translate(-absPathRect.
x(), -absPathRect.
y());
428 p.setTransform(
state->matrix,
true);
431 p.setBackground(
state->bgBrush);
432 p.setBackgroundMode(
state->bgMode);
433 p.setBrushOrigin(
state->brushOrigin);
439 p.drawPath(originalPath);
443 if (do_fallback_overlay) {
466 engine->drawImage(absPathRect,
505 b.setTransform(
b.transform() * gradientToUser);
507 b.setTransform(gradientToUser *
b.transform());
518 bool changedPen =
false;
519 bool changedBrush =
false;
520 bool needsFill =
false;
538 const qreal isw = 1.0 / sw;
539 const qreal ish = 1.0 / sh;
579 const qreal isw = 1.0 / sw;
580 const qreal ish = 1.0 / sh;
582 engine->drawPath(stroke * inv);
601 }
else if (changedPen) {
609 }
else if (needsFill) {
658 bool linearGradient =
false;
659 bool radialGradient =
false;
660 bool extendedRadialGradient =
false;
661 bool conicalGradient =
false;
662 bool patternBrush =
false;
664 bool complexXform =
false;
686 && (brushStyle < Qt::LinearGradientPattern && s->
brush.color().alpha() != 255)
687 && !
s->brush.isOpaque());
702 bool penTextureAlpha =
false;
707 bool brushTextureAlpha =
false;
710 ? (
s->brush.texture().depth() > 1) &&
s->brush.texture().hasAlpha()
711 :
s->brush.textureImage().hasAlphaChannel();
731 qDebug(
"QPainterPrivate::updateEmulationSpecifier, state=%p\n"
733 " - linearGradient: %d\n"
734 " - radialGradient: %d\n"
735 " - conicalGradient: %d\n"
736 " - patternBrush: %d\n"
745 uint(
s->renderHints),
752 complexXform = !
s->matrix.isAffine();
761 const bool patternXform = patternBrush && (
xform || brushXform || penXform);
817 bool gradientStretch =
false;
818 bool objectBoundingMode =
false;
819 if (linearGradient || conicalGradient || radialGradient) {
832 s->emulationSpecifier &= ~QGradient_StretchToDevice;
837 s->emulationSpecifier &=
~QPaintEngine::ObjectBoundingModeGradients;
844 s->emulationSpecifier &= ~QPaintEngine_OpaqueBackground;
1478 d_ptr->inDestructor =
true;
1482 else if (d_ptr->refcount > 1)
1483 d_ptr->detachPainterPrivate(
this);
1490 d_ptr->inDestructor =
false;
1505 if (
isActive() &&
d->engine->d_func()->currentClipDevice)
1506 return d->engine->d_func()->currentClipDevice;
1507 return d->original_device;
1520 return d->engine !=
nullptr;
1526 qWarning(
"QPainter::initFrom: Painter not active, aborted");
1553 if (qt_show_painter_debug_output)
1554 printf(
"QPainter::save()\n");
1558 qWarning(
"QPainter::save: Painter not active");
1562 std::unique_ptr<QPainterState> prev;
1566 std::unique_ptr<QPainterState>
next(
d->extended->createState(
d->state.get()));
1567 prev = std::exchange(
d->state, std::move(
next));
1568 d->extended->setState(
d->state.get());
1570 d->updateState(
d->state);
1571 prev = std::exchange(
d->state, std::make_unique<QPainterState>(
d->state.get()));
1572 d->engine->state =
d->state.get();
1574 d->savedStates.push(std::move(prev));
1587 if (qt_show_painter_debug_output)
1588 printf(
"QPainter::restore()\n");
1591 if (
d->savedStates.empty()) {
1592 qWarning(
"QPainter::restore: Unbalanced save/restore");
1594 }
else if (!
d->engine) {
1595 qWarning(
"QPainter::restore: Painter not active");
1599 const auto tmp = std::exchange(
d->state, std::move(
d->savedStates.top()));
1600 d->savedStates.pop();
1604 d->checkEmulation();
1605 d->extended->setState(
d->state.get());
1611 if (!
d->state->clipInfo.isEmpty()
1617 d->engine->updateState(*tmp);
1620 tmp->matrix =
info.matrix;
1621 tmp->clipOperation =
info.operation;
1624 tmp->clipRegion =
info.rect;
1627 tmp->clipRegion =
info.region;
1632 d->engine->updateState(*tmp);
1642 d->updateState(
d->state.get());
1675 d->savedStates.clear();
1677 d->engine =
nullptr;
1678 d->device =
nullptr;
1686 qWarning(
"QPainter::begin: A paint device can only be painted by one painter at a time.");
1690 if (d_ptr->engine) {
1691 qWarning(
"QPainter::begin: Painter already active");
1700 d->helper_device = pd;
1701 d->original_device = pd;
1703 QPoint redirectionOffset;
1709 if (qt_show_painter_debug_output)
1710 printf(
"QPainter::begin(), device=%p, type=%d\n", pd, pd->
devType());
1714 static_cast<QPixmap *
>(pd)->detach();
1721 qWarning(
"QPainter::begin: Paint device returned engine == 0, type: %d", pd->
devType());
1727 d->extended =
d->engine->isExtended() ?
static_cast<QPaintEngineEx *
>(
d->engine.get()) :
nullptr;
1728 if (
d->emulationEngine)
1729 d->emulationEngine->real_engine =
d->extended;
1733 d->state.reset(
d->extended ?
d->extended->createState(
nullptr) :
new QPainterState);
1734 d->state->painter =
this;
1736 d->state->redirectionMatrix.translate(-redirectionOffset.
x(), -redirectionOffset.
y());
1741 d->extended->setState(
d->state.get());
1743 d->engine->state =
d->state.get();
1751 qWarning(
"QPainter::begin: Cannot paint on a null pixmap");
1756 if (pm->
depth() == 1) {
1766 if (
img->isNull()) {
1767 qWarning(
"QPainter::begin: Cannot paint on a null image");
1772 qWarning(
"QPainter::begin: Cannot paint on an image with the QImage::Format_Indexed8 format");
1776 if (
img->depth() == 1) {
1785 if (
d->state->ww == 0)
1786 d->state->ww =
d->state->wh =
d->state->vw =
d->state->vh = 1024;
1788 d->engine->setPaintDevice(pd);
1790 bool begun =
d->engine->begin(pd);
1792 qWarning(
"QPainter::begin(): Returned false");
1793 if (
d->engine->isActive()) {
1800 d->engine->setActive(begun);
1806 d->initFrom(
d->original_device);
1810 d->state->deviceFont =
d->state->font =
QFont(
d->state->deviceFont,
device());
1813 QRect systemRect =
d->engine->systemRect();
1815 d->state->ww =
d->state->vw = systemRect.
width();
1816 d->state->wh =
d->state->vh = systemRect.
height();
1822 const QPoint coordinateOffset =
d->engine->coordinateOffset();
1823 d->state->redirectionMatrix.translate(-coordinateOffset.
x(), -coordinateOffset.
y());
1827 if (!
d->state->redirectionMatrix.isIdentity() ||
d->effectiveDevicePixelRatio() > 1)
1832 ++
d->device->painters;
1834 d->state->emulationSpecifier = 0;
1852 if (qt_show_painter_debug_output)
1853 printf(
"QPainter::end()\n");
1858 qWarning(
"QPainter::end: Painter not active, aborted");
1863 if (
d->refcount > 1) {
1864 d->detachPainterPrivate(
this);
1870 if (
d->engine->isActive()) {
1871 ended =
d->engine->end();
1872 d->updateState(
nullptr);
1874 --
d->device->painters;
1875 if (
d->device->painters == 0) {
1876 d->engine->setPaintDevice(
nullptr);
1877 d->engine->setActive(
false);
1881 if (
d->savedStates.size() > 0) {
1882 qWarning(
"QPainter::end: Painter ended with %d saved states",
int(
d->savedStates.size()));
1886 d->emulationEngine =
nullptr;
1887 d->extended =
nullptr;
1904 return d->engine.get();
1943 qWarning(
"QPainter::beginNativePainting: Painter not active");
1948 d->extended->beginNativePainting();
1964 qWarning(
"QPainter::beginNativePainting: Painter not active");
1969 d->extended->endNativePainting();
1971 d->engine->syncState();
1985 qWarning(
"QPainter::fontMetrics: Painter not active");
2003 qWarning(
"QPainter::fontInfo: Painter not active");
2020 qWarning(
"QPainter::opacity: Painter not active");
2023 return d->state->opacity;
2042 qWarning(
"QPainter::setOpacity: Painter not active");
2054 d->extended->opacityChanged();
2070 qWarning(
"QPainter::brushOrigin: Painter not active");
2098 if (qt_show_painter_debug_output)
2099 printf(
"QPainter::setBrushOrigin(), (%.2f,%.2f)\n",
p.x(),
p.y());
2103 qWarning(
"QPainter::setBrushOrigin: Painter not active");
2107 d->state->brushOrigin =
p;
2110 d->extended->brushOriginChanged();
2329 qWarning(
"QPainter::setCompositionMode: Painter not active");
2332 if (
d->state->composition_mode ==
mode)
2335 d->state->composition_mode =
mode;
2336 d->extended->compositionModeChanged();
2342 qWarning(
"QPainter::setCompositionMode: "
2343 "Raster operation modes not supported on device");
2348 qWarning(
"QPainter::setCompositionMode: "
2349 "Blend modes not supported on device");
2354 qWarning(
"QPainter::setCompositionMode: "
2355 "PorterDuff modes not supported on device");
2360 d->state->composition_mode =
mode;
2373 qWarning(
"QPainter::compositionMode: Painter not active");
2376 return d->state->composition_mode;
2389 qWarning(
"QPainter::background: Painter not active");
2390 return d->fakeState()->brush;
2392 return d->state->bgBrush;
2406 qWarning(
"QPainter::hasClipping: Painter not active");
2409 return d->state->clipEnabled &&
d->state->clipOperation !=
Qt::NoClip;
2424 if (qt_show_painter_debug_output)
2425 printf(
"QPainter::setClipping(), enable=%s, was=%s\n",
2430 qWarning(
"QPainter::setClipping: Painter not active, state will be reset by begin");
2439 && (
d->state->clipInfo.isEmpty() ||
d->state->clipInfo.constLast().operation ==
Qt::NoClip))
2441 d->state->clipEnabled =
enable;
2444 d->extended->clipEnabledChanged();
2449 d->updateState(
d->state);
2469 qWarning(
"QPainter::clipRegion: Painter not active");
2474 bool lastWasNothing =
true;
2477 const_cast<QPainter *
>(
this)->d_ptr->updateInvMatrix();
2481 switch (
info.clipType) {
2485 if (lastWasNothing) {
2487 lastWasNothing =
false;
2493 lastWasNothing =
true;
2502 if (lastWasNothing) {
2505 lastWasNothing =
false;
2512 lastWasNothing =
true;
2523 if (lastWasNothing) {
2525 lastWasNothing =
false;
2535 lastWasNothing =
true;
2545 if (lastWasNothing) {
2547 lastWasNothing =
false;
2553 region &=
matrix.mapRect(
info.rectf.toRect());
2557 lastWasNothing =
true;
2589 qWarning(
"QPainter::clipPath: Painter not active");
2594 if (
d->state->clipInfo.isEmpty()) {
2600 const_cast<QPainter *
>(
this)->d_ptr->updateInvMatrix();
2603 if (
d->state->clipInfo.size() == 1
2606 return d->state->clipInfo.at(0).path *
matrix;
2608 }
else if (
d->state->clipInfo.size() == 1
2612 path.addRect(
d->state->clipInfo.at(0).rect);
2638 qWarning(
"QPainter::clipBoundingRect: Painter not active");
2655 r =
info.region.boundingRect();
2659 r =
info.matrix.mapRect(
r);
2672 const_cast<QPainter *
>(
this)->d_ptr->updateInvMatrix();
2674 return d->invMatrix.mapRect(bounds);
2695 qWarning(
"QPainter::setClipRect: Painter not active");
2699 if (simplifyClipOp && (!
d->state->clipEnabled && op !=
Qt::NoClip))
2709 d->state->clipEnabled =
true;
2710 d->extended->clip(vp, op);
2712 d->state->clipInfo.clear();
2714 d->state->clipOperation = op;
2727 if (
rect.isEmpty()) {
2749 qWarning(
"QPainter::setClipRect: Painter not active");
2754 if (simplifyClipOp && (!
d->state->clipEnabled && op !=
Qt::NoClip))
2758 d->state->clipEnabled =
true;
2759 d->extended->clip(
rect, op);
2761 d->state->clipInfo.clear();
2763 d->state->clipOperation = op;
2770 d->state->clipRegion =
rect;
2771 d->state->clipOperation = op;
2773 d->state->clipInfo.clear();
2775 d->state->clipEnabled =
true;
2777 d->updateState(
d->state);
2803 if (qt_show_painter_debug_output)
2804 printf(
"QPainter::setClipRegion(), size=%d, [%d,%d,%d,%d]\n",
2808 qWarning(
"QPainter::setClipRegion: Painter not active");
2813 if (simplifyClipOp && (!
d->state->clipEnabled && op !=
Qt::NoClip))
2817 d->state->clipEnabled =
true;
2818 d->extended->clip(
r, op);
2820 d->state->clipInfo.clear();
2822 d->state->clipOperation = op;
2829 d->state->clipRegion =
r;
2830 d->state->clipOperation = op;
2832 d->state->clipInfo.clear();
2834 d->state->clipEnabled =
true;
2836 d->updateState(
d->state);
2854 if (qt_show_painter_debug_output)
2855 printf(
"QPainter::setMatrixEnabled(), enable=%d\n",
enable);
2859 qWarning(
"QPainter::setMatrixEnabled: Painter not active");
2882 qWarning(
"QPainter::worldMatrixEnabled: Painter not active");
2885 return d->state->WxF;
2897 if (qt_show_painter_debug_output)
2898 printf(
"QPainter::scale(), sx=%f, sy=%f\n", sx, sy);
2902 qWarning(
"QPainter::scale: Painter not active");
2906 d->state->worldMatrix.scale(sx,sy);
2907 d->state->WxF =
true;
2920 if (qt_show_painter_debug_output)
2921 printf(
"QPainter::shear(), sh=%f, sv=%f\n", sh, sv);
2925 qWarning(
"QPainter::shear: Painter not active");
2929 d->state->worldMatrix.shear(sh, sv);
2930 d->state->WxF =
true;
2945 if (qt_show_painter_debug_output)
2946 printf(
"QPainter::rotate(), angle=%f\n",
a);
2950 qWarning(
"QPainter::rotate: Painter not active");
2954 d->state->worldMatrix.rotate(
a);
2955 d->state->WxF =
true;
2970 if (qt_show_painter_debug_output)
2971 printf(
"QPainter::translate(), dx=%f, dy=%f\n", dx, dy);
2975 qWarning(
"QPainter::translate: Painter not active");
2979 d->state->worldMatrix.translate(dx, dy);
2980 d->state->WxF =
true;
3013 if (qt_show_painter_debug_output) {
3015 printf(
"QPainter::setClipPath(), size=%d, op=%d, bounds=[%.2f,%.2f,%.2f,%.2f]\n",
3016 path.elementCount(), op,
b.x(),
b.y(),
b.width(),
b.height());
3022 qWarning(
"QPainter::setClipPath: Painter not active");
3027 if (simplifyClipOp && (!
d->state->clipEnabled && op !=
Qt::NoClip))
3031 d->state->clipEnabled =
true;
3032 d->extended->clip(
path, op);
3034 d->state->clipInfo.clear();
3036 d->state->clipOperation = op;
3043 d->state->clipPath =
path;
3044 d->state->clipOperation = op;
3046 d->state->clipInfo.clear();
3048 d->state->clipEnabled =
true;
3050 d->updateState(
d->state);
3064 qWarning(
"QPainter::strokePath: Painter not active");
3076 QBrush oldBrush =
d->state->brush;
3077 QPen oldPen =
d->state->pen;
3104 qWarning(
"QPainter::fillPath: Painter not active");
3116 QBrush oldBrush =
d->state->brush;
3117 QPen oldPen =
d->state->pen;
3147 if (qt_show_painter_debug_output)
3148 printf(
"QPainter::drawPath(), size=%d, [%.2f,%.2f,%.2f,%.2f]\n",
3149 path.elementCount(),
3150 pathBounds.
x(), pathBounds.
y(), pathBounds.
width(), pathBounds.
height());
3156 qWarning(
"QPainter::drawPath: Painter not active");
3161 d->extended->drawPath(
path);
3164 d->updateState(
d->state);
3167 d->engine->drawPath(
path);
3169 d->draw_helper(
path);
3262 if (qt_show_painter_debug_output)
3263 printf(
"QPainter::drawRects(), count=%d\n", rectCount);
3268 qWarning(
"QPainter::drawRects: Painter not active");
3276 d->extended->drawRects(rects, rectCount);
3280 d->updateState(
d->state);
3282 if (!
d->state->emulationSpecifier) {
3283 d->engine->drawRects(rects, rectCount);
3289 for (
int i=0;
i<rectCount; ++
i) {
3290 QRectF r(rects[
i].
x() +
d->state->matrix.dx(),
3291 rects[
i].
y() +
d->state->matrix.dy(),
3294 d->engine->drawRects(&
r, 1);
3297 if (
d->state->brushNeedsResolving() ||
d->state->penNeedsResolving()) {
3298 for (
int i=0;
i<rectCount; ++
i) {
3305 for (
int i=0;
i<rectCount; ++
i)
3322 if (qt_show_painter_debug_output)
3323 printf(
"QPainter::drawRects(), count=%d\n", rectCount);
3328 qWarning(
"QPainter::drawRects: Painter not active");
3336 d->extended->drawRects(rects, rectCount);
3340 d->updateState(
d->state);
3342 if (!
d->state->emulationSpecifier) {
3343 d->engine->drawRects(rects, rectCount);
3349 for (
int i=0;
i<rectCount; ++
i) {
3350 QRectF r(rects[
i].
x() +
d->state->matrix.dx(),
3351 rects[
i].
y() +
d->state->matrix.dy(),
3355 d->engine->drawRects(&
r, 1);
3358 if (
d->state->brushNeedsResolving() ||
d->state->penNeedsResolving()) {
3359 for (
int i=0;
i<rectCount; ++
i) {
3366 for (
int i=0;
i<rectCount; ++
i)
3422 if (qt_show_painter_debug_output)
3423 printf(
"QPainter::drawPoints(), count=%d\n", pointCount);
3428 qWarning(
"QPainter::drawPoints: Painter not active");
3432 if (pointCount <= 0)
3436 d->extended->drawPoints(
points, pointCount);
3440 d->updateState(
d->state);
3442 if (!
d->state->emulationSpecifier) {
3443 d->engine->drawPoints(
points, pointCount);
3450 for (
int i=0;
i<pointCount; ++
i) {
3452 points[
i].y() +
d->state->matrix.dy());
3453 d->engine->drawPoints(&pt, 1);
3464 for (
int i=0;
i<pointCount; ++
i) {
3484 if (qt_show_painter_debug_output)
3485 printf(
"QPainter::drawPoints(), count=%d\n", pointCount);
3490 qWarning(
"QPainter::drawPoints: Painter not active");
3494 if (pointCount <= 0)
3498 d->extended->drawPoints(
points, pointCount);
3502 d->updateState(
d->state);
3504 if (!
d->state->emulationSpecifier) {
3505 d->engine->drawPoints(
points, pointCount);
3512 for (
int i=0;
i<pointCount; ++
i) {
3514 points[
i].y() +
d->state->matrix.dy());
3515 d->engine->drawPoints(&pt, 1);
3526 for (
int i=0;
i<pointCount; ++
i) {
3569 if (qt_show_painter_debug_output)
3570 printf(
"QPainter::setBackgroundMode(), mode=%d\n",
mode);
3575 qWarning(
"QPainter::setBackgroundMode: Painter not active");
3578 if (
d->state->bgMode ==
mode)
3581 d->state->bgMode =
mode;
3583 d->checkEmulation();
3598 qWarning(
"QPainter::backgroundMode: Painter not active");
3601 return d->state->bgMode;
3615 if (qt_show_painter_debug_output)
3616 printf(
"QPainter::setPen(), color=%04x\n",
color.rgb());
3620 qWarning(
"QPainter::setPen: Painter not active");
3626 if (
d->state->pen ==
pen)
3629 d->state->pen =
pen;
3631 d->extended->penChanged();
3649 if (qt_show_painter_debug_output)
3650 printf(
"QPainter::setPen(), color=%04x, (brushStyle=%d) style=%d, cap=%d, join=%d\n",
3655 qWarning(
"QPainter::setPen: Painter not active");
3659 if (
d->state->pen ==
pen)
3662 d->state->pen =
pen;
3665 d->checkEmulation();
3666 d->extended->penChanged();
3684 qWarning(
"QPainter::setPen: Painter not active");
3690 if (
d->state->pen ==
pen)
3693 d->state->pen =
pen;
3696 d->extended->penChanged();
3712 qWarning(
"QPainter::pen: Painter not active");
3713 return d->fakeState()->pen;
3715 return d->state->pen;
3730 if (qt_show_painter_debug_output)
3731 printf(
"QPainter::setBrush(), color=%04x, style=%d\n",
brush.color().rgb(),
brush.style());
3735 qWarning(
"QPainter::setBrush: Painter not active");
3739 if (
d->state->brush.d ==
brush.d)
3744 d->checkEmulation();
3745 d->extended->brushChanged();
3765 qWarning(
"QPainter::setBrush: Painter not active");
3768 if (
d->state->brush.style() == style &&
3774 d->extended->brushChanged();
3789 qWarning(
"QPainter::brush: Painter not active");
3790 return d->fakeState()->brush;
3792 return d->state->brush;
3811 if (qt_show_painter_debug_output)
3812 printf(
"QPainter::setBackground(), color=%04x, style=%d\n", bg.
color().
rgb(), bg.
style());
3817 qWarning(
"QPainter::setBackground: Painter not active");
3820 d->state->bgBrush = bg;
3843 if (qt_show_painter_debug_output)
3844 printf(
"QPainter::setFont(), family=%s, pointSize=%d\n",
font.
families().first().toLatin1().constData(),
font.
pointSize());
3848 qWarning(
"QPainter::setFont: Painter not active");
3866 qWarning(
"QPainter::font: Painter not active");
3867 return d->fakeState()->font;
3869 return d->state->font;
3899 if (qt_show_painter_debug_output)
3900 printf(
"QPainter::drawRoundedRect(), [%.2f,%.2f,%.2f,%.2f]\n",
rect.x(),
rect.y(),
rect.width(),
rect.height());
3907 if (xRadius <= 0 || yRadius <= 0) {
3913 d->extended->drawRoundedRect(
rect, xRadius, yRadius,
mode);
3961 if (qt_show_painter_debug_output)
3962 printf(
"QPainter::drawEllipse(), [%.2f,%.2f,%.2f,%.2f]\n",
r.x(),
r.y(),
r.width(),
r.height());
3972 d->extended->drawEllipse(
rect);
3976 d->updateState(
d->state);
3977 if (
d->state->emulationSpecifier) {
3980 rect.translate(
QPointF(
d->state->matrix.dx(),
d->state->matrix.dy()));
3989 d->engine->drawEllipse(
rect);
4002 if (qt_show_painter_debug_output)
4003 printf(
"QPainter::drawEllipse(), [%d,%d,%d,%d]\n",
r.x(),
r.y(),
r.width(),
r.height());
4013 d->extended->drawEllipse(
rect);
4017 d->updateState(
d->state);
4019 if (
d->state->emulationSpecifier) {
4031 d->engine->drawEllipse(
rect);
4088 if (qt_show_painter_debug_output)
4089 printf(
"QPainter::drawArc(), [%.2f,%.2f,%.2f,%.2f], angle=%d, sweep=%d\n",
4090 r.x(),
r.y(),
r.width(),
r.height(),
a/16, alen/16);
4150 if (qt_show_painter_debug_output)
4151 printf(
"QPainter::drawPie(), [%.2f,%.2f,%.2f,%.2f], angle=%d, sweep=%d\n",
4152 r.x(),
r.y(),
r.width(),
r.height(),
a/16, alen/16);
4163 if (
a < 0)
a += (360*16);
4171 path.closeSubpath();
4219 if (qt_show_painter_debug_output)
4220 printf(
"QPainter::drawChord(), [%.2f,%.2f,%.2f,%.2f], angle=%d, sweep=%d\n",
4221 r.x(),
r.y(),
r.width(),
r.height(),
a/16, alen/16);
4233 path.closeSubpath();
4266 if (qt_show_painter_debug_output)
4267 printf(
"QPainter::drawLines(), line count=%d\n", lineCount);
4272 if (!
d->engine || lineCount < 1)
4276 d->extended->drawLines(lines, lineCount);
4280 d->updateState(
d->state);
4284 if (lineEmulation) {
4287 for (
int i = 0;
i < lineCount; ++
i) {
4289 line.translate(
d->state->matrix.dx(),
d->state->matrix.dy());
4290 d->engine->drawLines(&
line, 1);
4294 for (
int i = 0;
i < lineCount; ++
i) {
4302 d->engine->drawLines(lines, lineCount);
4315 if (qt_show_painter_debug_output)
4316 printf(
"QPainter::drawLine(), line count=%d\n", lineCount);
4321 if (!
d->engine || lineCount < 1)
4325 d->extended->drawLines(lines, lineCount);
4329 d->updateState(
d->state);
4333 if (lineEmulation) {
4336 for (
int i = 0;
i < lineCount; ++
i) {
4338 line.translate(
d->state->matrix.dx(),
d->state->matrix.dy());
4339 d->engine->drawLines(&
line, 1);
4343 for (
int i = 0;
i < lineCount; ++
i) {
4351 d->engine->drawLines(lines, lineCount);
4434 if (qt_show_painter_debug_output)
4435 printf(
"QPainter::drawPolyline(), count=%d\n", pointCount);
4439 if (!
d->engine || pointCount < 2)
4447 d->updateState(
d->state);
4451 if (lineEmulation) {
4457 for (
int i=1;
i<pointCount; ++
i)
4475 if (qt_show_painter_debug_output)
4476 printf(
"QPainter::drawPolyline(), count=%d\n", pointCount);
4480 if (!
d->engine || pointCount < 2)
4488 d->updateState(
d->state);
4492 if (lineEmulation) {
4498 for (
int i=1;
i<pointCount; ++
i)
4550 if (qt_show_painter_debug_output)
4551 printf(
"QPainter::drawPolygon(), count=%d\n", pointCount);
4556 if (!
d->engine || pointCount < 2)
4564 d->updateState(
d->state);
4566 uint emulationSpecifier =
d->state->emulationSpecifier;
4568 if (emulationSpecifier) {
4570 for (
int i=1;
i<pointCount; ++
i)
4574 d->draw_helper(polygonPath);
4589 if (qt_show_painter_debug_output)
4590 printf(
"QPainter::drawPolygon(), count=%d\n", pointCount);
4595 if (!
d->engine || pointCount < 2)
4603 d->updateState(
d->state);
4605 uint emulationSpecifier =
d->state->emulationSpecifier;
4607 if (emulationSpecifier) {
4609 for (
int i=1;
i<pointCount; ++
i)
4613 d->draw_helper(polygonPath);
4688 if (qt_show_painter_debug_output)
4689 printf(
"QPainter::drawConvexPolygon(), count=%d\n", pointCount);
4694 if (!
d->engine || pointCount < 2)
4702 d->updateState(
d->state);
4704 uint emulationSpecifier =
d->state->emulationSpecifier;
4706 if (emulationSpecifier) {
4708 for (
int i=1;
i<pointCount; ++
i)
4712 d->draw_helper(polygonPath);
4722 if (qt_show_painter_debug_output)
4723 printf(
"QPainter::drawConvexPolygon(), count=%d\n", pointCount);
4728 if (!
d->engine || pointCount < 2)
4736 d->updateState(
d->state);
4738 uint emulationSpecifier =
d->state->emulationSpecifier;
4740 if (emulationSpecifier) {
4742 for (
int i=1;
i<pointCount; ++
i)
4746 d->draw_helper(polygonPath);
4755 return m.inverted().map(
QPointF(
m.map(
p).toPoint()));
4785#if defined QT_DEBUG_DRAW
4786 if (qt_show_painter_debug_output)
4787 printf(
"QPainter::drawPixmap(), p=[%.2f,%.2f], pix=[%d,%d]\n",
4794 if (!
d->engine || pm.
isNull())
4802 d->extended->drawPixmap(
p, pm);
4820 d->updateState(
d->state);
4847 x +=
d->state->matrix.dx();
4848 y +=
d->state->matrix.dy();
4857#if defined QT_DEBUG_DRAW
4858 if (qt_show_painter_debug_output)
4859 printf(
"QPainter::drawPixmap(), target=[%.2f,%.2f,%.2f,%.2f], pix=[%d,%d], source=[%.2f,%.2f,%.2f,%.2f]\n",
4860 r.x(),
r.y(),
r.width(),
r.height(),
4866 if (!
d->engine || pm.
isNull())
4888 sw = pm.
width() - sx;
4899 qreal w_ratio = sx *
w/sw;
4907 qreal h_ratio = sy *
h/sh;
4914 if (sw + sx > pm.
width()) {
4916 qreal w_ratio = delta *
w/sw;
4921 if (sh + sy > pm.
height()) {
4923 qreal h_ratio = delta *
h/sh;
4928 if (
w == 0 ||
h == 0 || sw <= 0 || sh <= 0)
4940 d->updateState(
d->state);
4982 x +=
d->state->matrix.dx();
4983 y +=
d->state->matrix.dy();
5096 if (!
d->engine ||
image.isNull())
5100 d->extended->drawImage(
p,
image);
5111 d->updateState(
d->state);
5140 x +=
d->state->matrix.dx();
5141 y +=
d->state->matrix.dy();
5148 Qt::ImageConversionFlags
flags)
5152 if (!
d->engine ||
image.isNull())
5159 qreal sx = sourceRect.
x();
5160 qreal sy = sourceRect.
y();
5167 sw =
image.width() - sx;
5170 sh =
image.height() - sy;
5173 w = sw / imageScale;
5175 h = sh / imageScale;
5178 qreal w_ratio = sx *
w/sw;
5186 qreal h_ratio = sy *
h/sh;
5193 if (sw + sx >
image.width()) {
5195 qreal w_ratio = delta *
w/sw;
5200 if (sh + sy >
image.height()) {
5202 qreal h_ratio = delta *
h/sh;
5207 if (
w == 0 ||
h == 0 || sw <= 0 || sh <= 0)
5215 d->updateState(
d->state);
5253 x +=
d->state->matrix.dx();
5254 y +=
d->state->matrix.dy();
5271#if !defined(QT_NO_RAWFONT)
5277 qWarning(
"QPainter::drawGlyphRun: Painter not active");
5282 if (!
font.isValid())
5294 bool engineRequiresPretransformedGlyphPositions =
d->extended
5295 ?
d->extended->requiresPretransformedGlyphPositions(fontD->
fontEngine,
d->state->matrix)
5300 if (engineRequiresPretransformedGlyphPositions)
5301 processedPosition =
d->state->transform().map(processedPosition);
5305 d->drawGlyphs(engineRequiresPretransformedGlyphPositions
5309 fixedPointPositions.
data(),
5350 memset(
static_cast<void *
>(advances.
data()), 0, advances.
size() *
sizeof(
QFixed));
5453 if (
font() != staticText_d->
font ||
fp ==
nullptr || stfp ==
nullptr ||
fp->dpi != stfp->
dpi) {
5467 if (
d->extended ==
nullptr
5468 || !
d->state->matrix.isAffine()
5474 bool engineRequiresPretransform =
d->extended->requiresPretransformedGlyphPositions(fe,
d->state->matrix);
5489 QPointF transformedPosition = topLeftPosition;
5491 transformedPosition = transformedPosition *
d->state->matrix;
5497 qreal m11 =
d->state->matrix.m11();
5498 qreal m12 =
d->state->matrix.m12();
5499 qreal m13 =
d->state->matrix.m13();
5500 qreal m21 =
d->state->matrix.m21();
5501 qreal m22 =
d->state->matrix.m22();
5502 qreal m23 =
d->state->matrix.m23();
5503 qreal m33 =
d->state->matrix.m33();
5505 oldMatrix =
d->state->matrix;
5506 d->state->matrix.setMatrix(m11, m12, m13,
5515 staticText_d->
matrix =
d->state->matrix;
5516 staticTextNeedsReinit =
true;
5520 if (staticTextNeedsReinit)
5521 staticText_d->
init();
5523 if (transformedPosition != staticText_d->
position) {
5537 staticText_d->
position = transformedPosition;
5540 QPen oldPen =
d->state->pen;
5542 static const QColor bodyIndicator(0, 0, 0, 0);
5545 if (
item->color.isValid() && currentColor !=
item->color
5546 &&
item->color != bodyIndicator) {
5548 currentColor =
item->color;
5549 }
else if (
item->color == bodyIndicator) {
5551 currentColor = oldPen.
color();
5553 d->extended->drawStaticTextItem(
item);
5558 item->glyphPositions,
5565 if (currentColor != oldPen.
color())
5569 d->state->matrix = oldMatrix;
5578 if (qt_show_painter_debug_output)
5588 engine.option.setTextDirection(
d->state->layoutDirection);
5590 engine.ignoreBidi =
true;
5598 int nItems =
engine.layoutData->items.size();
5601 for (
int i = 0;
i < nItems; ++
i)
5605 if (justificationPadding > 0) {
5607 engine.forceJustification =
true;
5609 line.width = justificationPadding;
5614 for (
int i = 0;
i < nItems; ++
i) {
5615 int item = visualOrder[
i];
5626 if (
engine.forceJustification) {
5643 if (qt_show_painter_debug_output)
5644 printf(
"QPainter::drawText(), r=[%d,%d,%d,%d], flags=%d, str='%s'\n",
5654 d->updateState(
d->state);
5730 if (qt_show_painter_debug_output)
5731 printf(
"QPainter::drawText(), r=[%.2f,%.2f,%.2f,%.2f], flags=%d, str='%s'\n",
5741 d->updateState(
d->state);
5849 if (qt_show_painter_debug_output)
5850 printf(
"QPainter::drawText(), r=[%.2f,%.2f,%.2f,%.2f], str='%s'\n",
5860 d->updateState(
d->state);
5914 const int width =
qCeil(100 / (2 * halfPeriod)) * (2 * halfPeriod);
5922 while (xs <
width) {
5925 path.quadTo(xs - halfPeriod / 2, ys, xs, 0);
5936 const qreal maxPenWidth = .8 * radius;
5937 if (wavePen.
widthF() > maxPenWidth)
5941 imgPainter.
setPen(wavePen);
5992 const int descent =
qFloor(maxHeight);
6000 qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5;
6001 if (underlineOffset <= fe->descent().toReal())
6003 const qreal underlinePos =
pos.y() + adjustedUnderlineOffset;
6010 QLineF underline(
line.x1(), underlinePos,
line.x2(), underlinePos);
6051 const QPointF &decorationPosition,
6060 if (!underline && !overline && !strikeOut)
6063 QTextItem::RenderFlags
flags;
6094 d->drawTextItem(
p, ti,
static_cast<QTextEngine *
>(
nullptr));
6100 if (qt_show_painter_debug_output)
6101 printf(
"QPainter::drawTextItem(), pos=[%.f,%.f], str='%s'\n",
6120 const QPainter::RenderHints oldRenderHints =
state->renderHints;
6128 bool isPlain90DegreeRotation =
6147 aa = !isPlain90DegreeRotation;
6163 int which = glyphs.
glyphs[0] >> 24;
6203 const int hi = which << 24;
6233 const int hi = which << 24;
6246 if (
state->renderHints != oldRenderHints) {
6247 state->renderHints = oldRenderHints;
6381 if (qt_show_painter_debug_output)
6382 printf(
"QPainter::drawTiledPixmap(), target=[%.2f,%.2f,%.2f,%.2f], pix=[%d,%d], offset=[%.2f,%.2f]\n",
6383 r.x(),
r.y(),
r.width(),
r.height(),
6389 if (!
d->engine ||
pixmap.isNull() ||
r.isEmpty())
6418 d->updateState(
d->state);
6453 x +=
d->state->matrix.dx();
6454 y +=
d->state->matrix.dy();
6482#ifndef QT_NO_PICTURE
6516 d->updateState(
d->state);
6628 d->extended->fillRect(
r,
brush);
6637 d->colorBrush.setColor(
brush.color());
6663 d->extended->fillRect(
r,
brush);
6672 d->colorBrush.setColor(
brush.color());
6701 d->extended->fillRect(
r,
color);
6725 d->extended->fillRect(
r,
color);
6824 if (qt_show_painter_debug_output)
6825 printf(
"QPainter::setRenderHint: hint=%x, %s\n",
hint, on ?
"on" :
"off");
6852 qWarning(
"QPainter::setRenderHint: Painter must be active to set rendering hints");
6857 d->state->renderHints |= hints;
6859 d->state->renderHints &= ~hints;
6862 d->extended->renderHintsChanged();
6880 return d->state->renderHints;
6903 qWarning(
"QPainter::viewTransformEnabled: Painter not active");
6906 return d->state->VxF;
6937 if (qt_show_painter_debug_output)
6938 printf(
"QPainter::setWindow(), [%d,%d,%d,%d]\n",
r.x(),
r.y(),
r.width(),
r.height());
6944 qWarning(
"QPainter::setWindow: Painter not active");
6948 d->state->wx =
r.x();
6949 d->state->wy =
r.y();
6950 d->state->ww =
r.width();
6951 d->state->wh =
r.height();
6953 d->state->VxF =
true;
6967 qWarning(
"QPainter::window: Painter not active");
6970 return QRect(
d->state->wx,
d->state->wy,
d->state->ww,
d->state->wh);
7001 if (qt_show_painter_debug_output)
7002 printf(
"QPainter::setViewport(), [%d,%d,%d,%d]\n",
r.x(),
r.y(),
r.width(),
r.height());
7008 qWarning(
"QPainter::setViewport: Painter not active");
7012 d->state->vx =
r.x();
7013 d->state->vy =
r.y();
7014 d->state->vw =
r.width();
7015 d->state->vh =
r.height();
7017 d->state->VxF =
true;
7031 qWarning(
"QPainter::viewport: Painter not active");
7034 return QRect(
d->state->vx,
d->state->vy,
d->state->vw,
d->state->vh);
7048 if (qt_show_painter_debug_output)
7049 printf(
"QPainter::setViewTransformEnabled(), enable=%d\n",
enable);
7055 qWarning(
"QPainter::setViewTransformEnabled: Painter not active");
7068 int tabstops,
int *ta,
int tabarraylen,
7072 tf,
nullptr,
str, brect,
7073 tabstops, ta, tabarraylen,
7078 int tabstops,
int *ta,
int tabarraylen,
7085 tf |=
option->alignment();
7092 if (
option->tabStopDistance() >= 0 || !
option->tabArray().isEmpty())
7127 uint maxUnderlines = 0;
7133 bool hasMoreLengthVariants =
false;
7139 if (chr == u
'\r' || (singleline && chr == u
'\n')) {
7141 }
else if (chr == u
'\n') {
7143 }
else if (chr == u
'&') {
7145 }
else if (chr == u
'\t') {
7148 }
else if (!tabarraylen && !tabstops) {
7151 }
else if (chr == u
'\x9c') {
7153 hasMoreLengthVariants =
true;
7160 if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) {
7162 QChar *cout0 = cout;
7174 range.start = cout - cout0;
7176 range.format.setFontUnderline(
true);
7180 }
else if (hidemnmemonic && *cin == u
'(' && l >= 4 &&
7181 cin[1] == u
'&' && cin[2] != u
'&' &&
7184 while ((cout -
n) > cout0 && (cout -
n - 1)->isSpace())
7209 if (
engine.option.tabStopDistance() < 0 && tabstops > 0)
7210 engine.option.setTabStopDistance(tabstops);
7212 if (
engine.option.tabs().isEmpty() && ta) {
7215 for (
int i = 0;
i < tabarraylen;
i++)
7217 engine.option.setTabArray(tabs);
7230 engine.forceJustification =
true;
7240 qreal lineWidth = 0x01000000;
7242 lineWidth = qMax<qreal>(0,
r.width());
7274 yoff = (
r.height() -
height)/2;
7277 xoff =
r.width() -
width;
7279 xoff = (
r.width() -
width)/2;
7285 goto start_lengthVariant;
7291 bool restore =
false;
7292 if (!dontclip && !
r.contains(bounds)) {
7303 qreal advance =
line.horizontalAdvance();
7306 xoff =
r.width() - advance -
7310 xoff = (
r.width() - advance) / 2;
7350 : brushOrigin(
s->brushOrigin),
font(
s->
font), deviceFont(
s->deviceFont),
7352 clipRegion(
s->clipRegion), clipPath(
s->clipPath),
7353 clipOperation(
s->clipOperation),
7354 renderHints(
s->renderHints), clipInfo(
s->clipInfo),
7355 worldMatrix(
s->worldMatrix),
matrix(
s->
matrix), redirectionMatrix(
s->redirectionMatrix),
7356 wx(
s->wx), wy(
s->wy), ww(
s->ww), wh(
s->wh),
7357 vx(
s->vx), vy(
s->vy), vw(
s->vw), vh(
s->vh),
7358 opacity(
s->opacity), WxF(
s->WxF), VxF(
s->VxF),
7360 layoutDirection(
s->layoutDirection),
7361 composition_mode(
s->composition_mode),
7362 emulationSpecifier(
s->emulationSpecifier), changeFlags(0)
7368 : brushOrigin(0, 0), WxF(
false), VxF(
false), clipEnabled(true),
7771 return static_cast<const QPainterState *
>(
this)->clipEnabled;
7801 return static_cast<const QPainterState *
>(
this)->composition_mode;
7874 qWarning(
"QPainter::deviceTransform: Painter not active");
7875 return d->fakeState()->transform;
7877 return d->state->matrix;
7893 if (qt_show_painter_debug_output)
7894 printf(
"QPainter::resetMatrix()\n");
7897 qWarning(
"QPainter::resetMatrix: Painter not active");
7901 d->state->wx =
d->state->wy =
d->state->vx =
d->state->vy = 0;
7908 d->extended->transformChanged();
7926 qWarning(
"QPainter::setWorldTransform: Painter not active");
7931 d->state->worldMatrix =
matrix *
d->state->worldMatrix;
7933 d->state->worldMatrix =
matrix;
7935 d->state->WxF =
true;
7947 qWarning(
"QPainter::worldTransform: Painter not active");
7948 return d->fakeState()->transform;
7950 return d->state->worldMatrix;
7964 qWarning(
"QPainter::combinedTransform: Painter not active");
7967 return d->state->worldMatrix *
d->viewTransform() *
d->hidpiScaleTransform();
7990 if (!
d->engine ||
pixmap.isNull())
7994 for (
int i = 0;
i < fragmentCount; ++
i) {
7995 QRectF sourceRect(fragments[
i].sourceLeft, fragments[
i].sourceTop,
7998 qWarning(
"QPainter::drawPixmapFragments - the source rect is not contained by the pixmap's rectangle");
8002 if (
d->engine->isExtended()) {
8003 d->extended->drawPixmapFragments(fragments, fragmentCount,
pixmap, hints);
8008 for (
int i = 0;
i < fragmentCount; ++
i) {
8012 if (fragments[
i].rotation == 0) {
8013 xOffset = fragments[
i].
x;
8014 yOffset = fragments[
i].
y;
8024 QRectF sourceRect(fragments[
i].sourceLeft, fragments[
i].sourceTop,
8143 p->draw_helper(
path, operation);
8148#include "moc_qpainter.cpp"
IOBluetoothDevice * device
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
QImage textureImage() const
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set.
const QColor & color() const
Returns the brush color.
Qt::BrushStyle style() const
Returns the brush style.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgb() const noexcept
Returns the RGB value of the color.
int alpha() const noexcept
Returns the alpha color component of this color.
QString name(NameFormat format=HexRgb) const
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
QString path() const
Returns the file's path.
static QFontCache * instance()
void ensureEngineAt(int at)
QFontEngine * engine(int at) const
virtual QFixed descent() const
virtual QFixed ascent() const
virtual QFixed lineThickness() const
virtual QFixed underlinePosition() const
virtual bool supportsTransformation(const QTransform &transform) const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
\reentrant \inmodule QtGui
qreal height() const
Returns the height of the font.
qreal leading() const
Returns the leading of the font.
qreal horizontalAdvance(const QString &string, int length=-1) const
Returns the horizontal advance in pixels of the first length characters of text.
\reentrant \inmodule QtGui
static QFontPrivate * get(const QFont &font)
QFontEngine * engineForScript(int script) const
QFontEngineData * engineData
bool strikeOut() const
Returns true if strikeout has been set; otherwise returns false.
bool underline() const
Returns true if underline has been set; otherwise returns false.
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
QStringList families() const
int pointSize() const
Returns the point size of the font.
bool overline() const
Returns true if overline has been set; otherwise returns false.
static QGlyphRunPrivate * get(const QGlyphRun &glyphRun)
int glyphPositionDataSize
const quint32 * glyphIndexData
const QPointF * glyphPositionData
The QGlyphRun class provides direct access to the internal glyphs in a font.
bool overline() const
Returns true if this QGlyphRun should be painted with an overline decoration.
bool strikeOut() const
Returns true if this QGlyphRun should be painted with a strike out decoration.
QRawFont rawFont() const
Returns the font selected for this QGlyphRun object.
bool underline() const
Returns true if this QGlyphRun should be painted with an underline decoration.
CoordinateMode coordinateMode() const
static QPlatformIntegration * platformIntegration()
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
static QPlatformTheme * platformTheme()
Qt::LayoutDirection layoutDirection
the default layout direction for this application
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false.
@ Format_ARGB32_Premultiplied
void translate(const QPointF &p)
Translates this line by the given offset.
void reserve(qsizetype size)
void append(parameter_type t)
qreal devicePixelRatio() const
virtual void initPainter(QPainter *painter) const
virtual int devType() const
virtual QPaintDevice * redirected(QPoint *offset) const
virtual QPainter * sharedPainter() const
virtual int metric(PaintDeviceMetric metric) const
virtual QPaintEngine * paintEngine() const =0
virtual void renderHintsChanged()=0
virtual void penChanged()=0
virtual uint flags() const
virtual void transformChanged()=0
virtual void setState(QPainterState *s)
virtual void drawStaticTextItem(QStaticTextItem *)
void setSystemTransform(const QTransform &xform)
QPaintDevice * currentClipDevice
virtual void systemStateChanged()
QTransform transform() const
QBrush backgroundBrush() const
Returns the background brush in the current paint engine state.
QPainterPath clipPath() const
Returns the clip path in the current paint engine state.
Qt::ClipOperation clipOperation() const
Returns the clip operation in the current paint engine state.
bool brushNeedsResolving() const
QPointF brushOrigin() const
Returns the brush origin in the current paint engine state.
QPaintEngine::DirtyFlags dirtyFlags
QPainter * painter() const
Returns a pointer to the painter currently updating the paint engine.
bool isClipEnabled() const
Returns whether clipping is enabled or not in the current paint engine state.
QBrush brush() const
Returns the brush in the current paint engine state.
QRegion clipRegion() const
Returns the clip region in the current paint engine state.
QPainter::RenderHints renderHints() const
Returns the render hints in the current paint engine state.
QFont font() const
Returns the font in the current paint engine state.
QPen pen() const
Returns the pen in the current paint engine state.
Qt::BGMode backgroundMode() const
Returns the background mode in the current paint engine state.
bool penNeedsResolving() const
QPainter::CompositionMode compositionMode() const
Returns the composition mode in the current paint engine state.
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
PolygonDrawMode
\value OddEvenMode The polygon should be drawn using OddEven fill rule.
@ ObjectBoundingModeGradients
virtual Type type() const =0
Reimplement this function to return the paint engine \l{Type}.
The QPainterPathStroker class is used to generate fillable outlines for a given painter path.
void setDashPattern(Qt::PenStyle)
Sets the dash pattern for the generated outlines to style.
void setCapStyle(Qt::PenCapStyle style)
Sets the cap style of the generated outlines to style.
void setWidth(qreal width)
Sets the width of the generated outline painter path to width.
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path.
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style of the generated outlines to style.
void setMiterLimit(qreal length)
Sets the miter limit of the generated outlines to limit.
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
void setFillRule(Qt::FillRule fillRule)
Sets the fill rule of the painter path to the given fillRule.
QRectF boundingRect() const
Returns the bounding rectangle of this painter path as a rectangle with floating point precision.
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation)
void updateEmulationSpecifier(QPainterState *s)
QPaintEngineEx * extended
QPaintDevice * helper_device
void initFrom(const QPaintDevice *device)
std::unique_ptr< QPaintEngine, QPaintEngineDestructor > engine
void updateState(QPainterState *state)
std::unique_ptr< QEmulationPaintEngine > emulationEngine
void draw_helper(const QPainterPath &path, DrawOperation operation=StrokeAndFillDraw)
QVarLengthArray< QPainterPrivate *, NDPtrs > d_ptrs
QPainterPrivate(QPainter *painter)
void drawTextItem(const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine)
void drawStretchedGradient(const QPainterPath &path, DrawOperation operation)
QTransform hidpiScaleTransform() const
void detachPainterPrivate(QPainter *q)
QTransform viewTransform() const
qreal effectiveDevicePixelRatio() const
std::unique_ptr< QPainterState > state
void updateStateImpl(QPainterState *state)
static bool attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
void drawGlyphs(const QPointF &decorationPosition, const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, QFontEngine *fontEngine, bool overline=false, bool underline=false, bool strikeOut=false)
QPainter::CompositionMode composition_mode
QList< QPainterClipInfo > clipInfo
QPainter::RenderHints renderHints
Qt::ClipOperation clipOperation
Qt::LayoutDirection layoutDirection
This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a ...
static PixmapFragment Q_GUI_EXPORT create(const QPointF &pos, const QRectF &sourceRect, qreal scaleX=1, qreal scaleY=1, qreal rotation=0, qreal opacity=1)
The QPainter class performs low-level painting on widgets and other paint devices.
const QBrush & background() const
Returns the current background brush.
CompositionMode compositionMode() const
Returns the current composition mode.
const QPen & pen() const
Returns the painter's current pen.
void setBackground(const QBrush &bg)
Sets the background brush of the painter to the given brush.
void setClipping(bool enable)
Enables clipping if enable is true, or disables clipping if enable is false.
Qt::LayoutDirection layoutDirection() const
Returns the layout direction used by the painter when drawing text.
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
QPainter()
Constructs a painter.
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling.
void drawConvexPolygon(const QPointF *points, int pointCount)
Draws the convex polygon defined by the first pointCount points in the array points using the current...
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or \nullptr if the painter is n...
void setWorldMatrixEnabled(bool enabled)
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
void drawPie(const QRectF &rect, int a, int alen)
Draws a pie defined by the given rectangle, startAngle and spanAngle.
void strokePath(const QPainterPath &path, const QPen &pen)
Draws the outline (strokes) the path path with the pen specified by pen.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, PixmapFragmentHints hints=PixmapFragmentHints())
void drawLine(const QLineF &line)
Draws a line defined by line.
void setViewport(const QRect &viewport)
Sets the painter's viewport rectangle to the given rectangle, and enables view transformations.
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
void drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
Draws the glyphs represented by glyphs at position.
QTransform combinedTransform() const
Returns the transformation matrix combining the current window/viewport and world transformation.
void drawTextItem(const QPointF &p, const QTextItem &ti)
void drawChord(const QRectF &rect, int a, int alen)
Draws the chord defined by the given rectangle, startAngle and spanAngle.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false.
void setBrushOrigin(int x, int y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawRects(const QRectF *rects, int rectCount)
Draws the first rectCount of the given rectangles using the current pen and brush.
void setClipPath(const QPainterPath &path, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip path for the painter to the given path, with the clip operation.
void setBackgroundMode(Qt::BGMode mode)
Sets the background mode of the painter to the given mode.
const QFont & font() const
Returns the currently set font used for drawing text.
bool worldMatrixEnabled() const
void setLayoutDirection(Qt::LayoutDirection direction)
Sets the layout direction used by the painter when drawing text, to the specified direction.
~QPainter()
Destroys the painter.
void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF())
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
void restore()
Restores the current painter state (pops a saved state off the stack).
void rotate(qreal a)
Rotates the coordinate system clockwise.
void scale(qreal sx, qreal sy)
Scales the coordinate system by ({sx}, {sy}).
const QTransform & worldTransform() const
Returns the world transformation matrix.
const QBrush & brush() const
Returns the painter's current brush.
void setOpacity(qreal opacity)
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
void beginNativePainting()
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void save()
Saves the current painter state (pushes the state onto a stack).
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
void shear(qreal sh, qreal sv)
Shears the coordinate system by ({sh}, {sv}).
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
void setFont(const QFont &f)
Sets the painter's font to the given font.
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
Qt::BGMode backgroundMode() const
Returns the current background mode.
QPainterPath clipPath() const
Returns the current clip path in logical coordinates.
void drawPolyline(const QPointF *points, int pointCount)
Draws the polyline defined by the first pointCount points in points using the current pen.
QRect viewport() const
Returns the viewport rectangle.
const QTransform & deviceTransform() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
void drawArc(const QRectF &rect, int a, int alen)
Draws the arc defined by the given rectangle, startAngle and spanAngle.
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
void fillPath(const QPainterPath &path, const QBrush &brush)
Fills the given path using the given brush.
QPoint brushOrigin() const
Returns the currently set brush origin.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
RenderHint
Renderhints are used to specify flags to QPainter that may or may not be respected by any given engin...
void drawPicture(const QPointF &p, const QPicture &picture)
Replays the given picture at the given point.
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText)
void drawPoints(const QPointF *points, int pointCount)
Draws the first pointCount points in the array points using the current pen's color.
bool viewTransformEnabled() const
Returns true if view transformation is enabled; otherwise returns false.
const QTransform & transform() const
Alias for worldTransform().
void resetTransform()
Resets any transformations that were made using translate(), scale(), shear(), rotate(),...
QRect window() const
Returns the window rectangle.
CompositionMode
Defines the modes supported for digital image compositing.
@ CompositionMode_SourceOver
@ CompositionMode_SourceAtop
@ RasterOp_SourceOrDestination
QRectF clipBoundingRect() const
Returns the bounding rectangle of the current clip if there is a clip; otherwise returns an empty rec...
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void setViewTransformEnabled(bool enable)
Enables view transformations if enable is true, or disables view transformations if enable is false.
bool isActive() const
Returns true if begin() has been called and end() has not yet been called; otherwise returns false.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
void setRenderHints(RenderHints hints, bool on=true)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
bool hasClipping() const
Returns true if clipping has been set; otherwise returns false.
void setWindow(const QRect &window)
Sets the painter's window to the given rectangle, and enables view transformations.
QFontInfo fontInfo() const
Returns the font info for the painter if the painter is active.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
void setTransform(const QTransform &transform, bool combine=false)
QRectF boundingRect(const QRectF &rect, int flags, const QString &text)
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle wi...
void setCapStyle(Qt::PenCapStyle pcs)
Sets the pen's cap style to the given style.
qreal widthF() const
Returns the pen width with floating point precision.
void setStyle(Qt::PenStyle)
[0]
QColor color() const
Returns the color of this pen's brush.
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
Qt::PenCapStyle capStyle() const
Returns the pen's cap style.
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
void setBrush(const QBrush &brush)
Sets the brush used to fill strokes generated with this pen to the given brush.
Qt::PenJoinStyle joinStyle() const
Returns the pen's join style.
qreal miterLimit() const
Returns the miter limit of the pen.
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Qt::PenStyle style() const
Returns the pen style.
The QPicture class is a paint device that records and replays QPainter commands.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
int height() const
Returns the height of the pixmap.
int depth() const
Returns the depth of the pixmap.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
int width() const
Returns the width of the pixmap.
QPixmap copy(int x, int y, int width, int height) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QRect rect() const
Returns the pixmap's enclosing rectangle.
qreal devicePixelRatio() const
Returns the device pixel ratio for the pixmap.
bool isQBitmap() const
Returns true if this is a QBitmap; otherwise returns false.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
static QRawFontPrivate * get(const QRawFont &font)
The QRawFont class provides access to a single physical instance of a font.
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
QRect toAlignedRect() const noexcept
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
bool contains(const QRectF &r) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QRectF intersected(const QRectF &other) const noexcept
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
The QRegion class specifies a clip region for a painter.
QFixedPoint * glyphPositions
void setFontEngine(QFontEngine *fe)
void paintText(const QPointF &pos, QPainter *p, const QColor &pen)
static QStaticTextPrivate * get(const QStaticText *q)
unsigned char needsRelayout
unsigned char untransformedCoordinates
The QStaticText class enables optimized drawing of text when the text and its layout is updated rarel...
QString text() const
Returns the text of the QStaticText.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QChar * data()
Returns a pointer to the data stored in the QString.
qsizetype length() const
Returns the number of characters in this string.
UnderlineStyle
This enum describes the different ways drawing underlined text.
QColor underlineColor() const
Returns the color used to draw underlines, overlines and strikeouts on the characters with this forma...
void enableDelayDecorations(bool enable=true)
void addOverline(QPainter *painter, const QLineF &line)
QFixed leadingSpaceWidth(const QScriptLine &line)
void drawDecorations(QPainter *painter)
void addStrikeOut(QPainter *painter, const QLineF &line)
void addUnderline(QPainter *painter, const QLineF &line)
static void bidiReorder(int numRuns, const quint8 *levels, int *visualOrder)
const QTextCharFormat charFormat
QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const
const unsigned short * logClusters
QTextCharFormat::UnderlineStyle underlineStyle
QString text() const
Returns the text that should be drawn.
QTextLine createLine()
Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise ret...
void beginLayout()
Begins the layout process.
QTextEngine * engine() const
void setCacheEnabled(bool enable)
Enables caching of the complete layout information if enable is true; otherwise disables layout cachi...
void setFormats(const QList< FormatRange > &overrides)
int lineCount() const
Returns the number of lines in this text layout.
QTextLine lineAt(int i) const
Returns the {i}-th line of text in this text layout.
void endLayout()
Ends the layout process.
qreal naturalTextWidth() const
Returns the width of the line that is occupied by text.
void setPosition(const QPointF &pos)
Moves the line to position pos.
bool isValid() const
Returns true if this text line is valid; otherwise returns false.
void setLineWidth(qreal width)
Lays out the line with the given width.
int lineNumber() const
Returns the position of the line in the text engine.
static QThread * currentThread()
constexpr size_type size() const noexcept
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
@ TextJustificationForced
@ TextIncludeTrailingSpaces
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
static Q_CONSTINIT Qt::LayoutDirection layout_direction
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
GLfloat GLfloat GLfloat alpha
GLenum GLenum GLenum GLenum GLenum scale
static const QRectF boundingRect(const QPointF *points, int pointCount)
const QVectorPath & qtVectorPathForPath(const QPainterPath &path)
bool qt_isExtendedRadialGradient(const QBrush &brush)
#define QPaintEngine_OpaqueBackground
static void qt_draw_decoration_for_glyphs(QPainter *painter, const QPointF &decorationPosition, const glyph_t *glyphArray, const QFixedPoint *positions, int glyphCount, QFontEngine *fontEngine, bool underline, bool overline, bool strikeOut)
static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine, QTextCharFormat::UnderlineStyle underlineStyle, QTextItem::RenderFlags flags, qreal width, const QTextCharFormat &charFormat)
static bool needsEmulation(const QBrush &brush)
static bool needsResolving(const QBrush &brush)
void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *option, const QString &str, QRectF *brect, int tabstops, int *tabarray, int tabarraylen, QPainter *painter)
static QPointF roundInDeviceCoordinates(const QPointF &p, const QTransform &m)
QPixmap qt_pixmapForBrush(int style, bool invert)
static bool is_brush_transparent(const QBrush &brush)
static QBrush stretchGradientToUserSpace(const QBrush &brush, const QRectF &boundingRect)
static bool qt_painter_thread_test(int devType, int engineType, const char *what)
static void qt_cleanup_painter_state(QPainterPrivate *d)
QPainterPath qt_regionToPath(const QRegion ®ion)
static QGradient::CoordinateMode coordinateMode(const QBrush &brush)
static uint line_emulation(uint emulation)
static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen)
void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivate::DrawOperation operation)
#define QGradient_StretchToDevice
static bool is_pen_transparent(const QPen &pen)
bool qHasPixmapTexture(const QBrush &)
Qt::BrushStyle qbrush_style(const QBrush &b)
Qt::PenStyle qpen_style(const QPen &p)
QBrush qpen_brush(const QPen &p)
QT_BEGIN_NAMESPACE void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, const QTextOption *opt, const QString &str, QRectF *brect, int tabstops, int *, int tabarraylen, QPainter *painter)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define qPrintable(string)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
QFileInfo info(fileName)
[8]
static constexpr QFixedPoint fromPointF(const QPointF &p)
static constexpr QFixed fromReal(qreal r)
constexpr qreal toReal() const
QGlyphJustification * justifications
QFixed effectiveAdvance(int item) const
QGlyphAttributes * attributes