summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 16:26:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-14 07:25:34 +0100
commit6239aee321fa07af3166136c2f425fec0a940648 (patch)
tree107caa55f2cbd34e660c74f14cbcc4cfd29d863f
parentd3534732ecf7664e0aa7e4ef38a684a41d077fc1 (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: Id8fb16dfd76ed43da95193b7785856c2694479b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--examples/speech/hello_speak/mainwindow.cpp2
-rw-r--r--src/plugins/tts/flite/qtexttospeech_flite_processor.cpp2
-rw-r--r--src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/speech/hello_speak/mainwindow.cpp b/examples/speech/hello_speak/mainwindow.cpp
index d0b1b37..3d4ef68 100644
--- a/examples/speech/hello_speak/mainwindow.cpp
+++ b/examples/speech/hello_speak/mainwindow.cpp
@@ -125,7 +125,7 @@ void MainWindow::localeChanged(const QLocale &locale)
m_voices = m_speech->availableVoices();
QVoice currentVoice = m_speech->voice();
- for (const QVoice &voice : qAsConst(m_voices)) {
+ for (const QVoice &voice : std::as_const(m_voices)) {
ui.voice->addItem(QString("%1 - %2 - %3").arg(voice.name())
.arg(QVoice::genderName(voice.gender()))
.arg(QVoice::ageName(voice.age())));
diff --git a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
index 49b23b2..c562a62 100644
--- a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
+++ b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
@@ -23,7 +23,7 @@ QTextToSpeechProcessorFlite::QTextToSpeechProcessorFlite(const QAudioDevice &aud
QTextToSpeechProcessorFlite::~QTextToSpeechProcessorFlite()
{
- for (const VoiceInfo &voice : qAsConst(m_voices))
+ for (const VoiceInfo &voice : std::as_const(m_voices))
voice.unregister_func(voice.vox);
}
diff --git a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
index c5a4ed2..60139c2 100644
--- a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
+++ b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
@@ -380,7 +380,7 @@ QList<QVoice> QTextToSpeechEngineSpeechd::availableVoices() const
// (history functions are just stubs)
void speech_finished_callback(size_t /*msg_id*/, size_t /*client_id*/, SPDNotificationType state)
{
- for (QTextToSpeechEngineSpeechd *backend : qAsConst(*backends))
+ for (QTextToSpeechEngineSpeechd *backend : std::as_const(*backends))
backend->spdStateChanged(state);
}