diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-11-11 16:26:04 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-18 13:59:41 +0100 |
commit | 3a07c391847b81c7bf40d95fc4d7c49f63073abc (patch) | |
tree | ae481ec0170e6cd53cbd09a28fc780fe0ab467d2 /src/gui/painting/qpainter.cpp | |
parent | c5f3c61469517a4ac00e4da01fe0bab9188c1488 (diff) | |
download | qtbase-3a07c391847b81c7bf40d95fc4d7c49f63073abc.tar.gz |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
This is a 6.4 re-run of the script we ran in dev, in order to avoid
conflicts between the branches when cherry-picking.
Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index a424954ad4..7e1b31dc8e 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -381,7 +381,7 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio if (q->hasClipping()) { bool hasPerspectiveTransform = false; - for (const QPainterClipInfo &info : qAsConst(state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(state->clipInfo)) { if (info.matrix.type() == QTransform::TxProject) { hasPerspectiveTransform = true; break; @@ -1616,7 +1616,7 @@ void QPainter::restore() tmp->clipPath = QPainterPath(); d->engine->updateState(*tmp); // replay the list of clip states, - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { tmp->matrix = info.matrix; tmp->matrix *= d->state->redirectionMatrix; tmp->clipOperation = info.operation; @@ -2478,7 +2478,7 @@ QRegion QPainter::clipRegion() const const_cast<QPainter *>(this)->d_ptr->updateInvMatrix(); // ### Falcon: Use QPainterPath - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { switch (info.clipType) { case QPainterClipInfo::RegionClip: { @@ -2645,7 +2645,7 @@ QRectF QPainter::clipBoundingRect() const // fast. QRectF bounds; bool first = true; - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { QRectF r; if (info.clipType == QPainterClipInfo::RectClip) |