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 /examples/widgets/painting/fontsampler | |
parent | c5f3c61469517a4ac00e4da01fe0bab9188c1488 (diff) |
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 'examples/widgets/painting/fontsampler')
-rw-r--r-- | examples/widgets/painting/fontsampler/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp index 1b1b816395..e2bd768f79 100644 --- a/examples/widgets/painting/fontsampler/mainwindow.cpp +++ b/examples/widgets/painting/fontsampler/mainwindow.cpp @@ -260,7 +260,7 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) bool italic = item->data(0, Qt::UserRole + 1).toBool(); // Calculate the maximum width and total height of the text. - for (int size : qAsConst(sampleSizes)) { + for (int size : std::as_const(sampleSizes)) { QFont font(family, size, weight, italic); font.setStyleName(style); font = QFont(font, painter->device()); @@ -294,7 +294,7 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) bool italic = item->data(0, Qt::UserRole + 1).toBool(); // Draw each line of text. - for (int size : qAsConst(sampleSizes)) { + for (int size : std::as_const(sampleSizes)) { QFont font(family, size, weight, italic); font.setStyleName(style); font = QFont(font, painter->device()); |