diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:42:43 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 18:20:23 +0200 |
commit | d6dfdf3ad3f68a97fd4fc2843a5d5fb424193b4b (patch) | |
tree | 2a9f9447f0a904174ead25287b1313fe728257b8 /src/linguist/linguist/messageeditor.cpp | |
parent | c338447261878111df7198fbd96051926464e865 (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.
Task-number: QTBUG-99313
Change-Id: I234704ba429750ddee958a82f6c941d041da0653
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/linguist/linguist/messageeditor.cpp')
-rw-r--r-- | src/linguist/linguist/messageeditor.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/linguist/linguist/messageeditor.cpp b/src/linguist/linguist/messageeditor.cpp index 3939ada5a..ee4a5c70b 100644 --- a/src/linguist/linguist/messageeditor.cpp +++ b/src/linguist/linguist/messageeditor.cpp @@ -192,7 +192,7 @@ void MessageEditor::messageModelAppended() void MessageEditor::allModelsDeleted() { - for (const MessageEditorData &med : qAsConst(m_editors)) + for (const MessageEditorData &med : std::as_const(m_editors)) med.container->deleteLater(); m_editors.clear(); m_currentModel = -1; @@ -293,7 +293,7 @@ void MessageEditor::fixTabOrder() void MessageEditor::reallyFixTabOrder() { QWidget *prev = this; - for (const MessageEditorData &med : qAsConst(m_editors)) { + for (const MessageEditorData &med : std::as_const(m_editors)) { for (FormMultiWidget *fmw : med.transTexts) for (QTextEdit *te : fmw->getEditors()) { setTabOrder(prev, te); @@ -549,7 +549,7 @@ void MessageEditor::showNothing() m_commentText->clearTranslation(); for (int j = 0; j < m_editors.size(); ++j) { setEditingEnabled(j, false); - for (FormMultiWidget *widget : qAsConst(m_editors[j].transTexts)) + for (FormMultiWidget *widget : std::as_const(m_editors[j].transTexts)) widget->clearTranslation(); m_editors[j].transCommentText->clearTranslation(); } @@ -664,7 +664,7 @@ void MessageEditor::setTranslation(int latestModel, const QString &translation) void MessageEditor::setEditingEnabled(int model, bool enabled) { MessageEditorData &ed = m_editors[model]; - for (FormMultiWidget *widget : qAsConst(ed.transTexts)) + for (FormMultiWidget *widget : std::as_const(ed.transTexts)) widget->setEditingEnabled(enabled); ed.transCommentText->setEditingEnabled(enabled); @@ -676,7 +676,7 @@ void MessageEditor::setEditingEnabled(int model, bool enabled) void MessageEditor::setLengthVariants(bool on) { m_lengthVariants = on; - for (const MessageEditorData &ed : qAsConst(m_editors)) + for (const MessageEditorData &ed : std::as_const(m_editors)) for (FormMultiWidget *widget : ed.transTexts) widget->setMultiEnabled(on); } @@ -863,7 +863,7 @@ void MessageEditor::setVisualizeWhitespace(bool value) m_pluralSource->getEditor()->setVisualizeWhitespace(value); m_commentText->getEditor()->setVisualizeWhitespace(value); - for (const MessageEditorData &med : qAsConst(m_editors)) { + for (const MessageEditorData &med : std::as_const(m_editors)) { med.transCommentText->getEditor()->setVisualizeWhitespace(value); for (FormMultiWidget *widget : med.transTexts) for (FormatTextEdit *te : widget->getEditors()) @@ -893,7 +893,7 @@ void MessageEditor::applyFontSize() m_pluralSource->getEditor()->setFont(font); m_commentText->getEditor()->setFont(font); - for (const MessageEditorData &med : qAsConst(m_editors)) { + for (const MessageEditorData &med : std::as_const(m_editors)) { for (FormMultiWidget *fmw : med.transTexts) for (QTextEdit *te : fmw->getEditors()) te->setFont(font); |