diff options
-rw-r--r-- | src/imports/audioengine/qaudioengine_openal_p.cpp | 6 | ||||
-rw-r--r-- | src/imports/audioengine/qdeclarative_audioengine_p.cpp | 11 | ||||
-rw-r--r-- | src/imports/multimedia/qdeclarativecamera.cpp | 8 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/imports/audioengine/qaudioengine_openal_p.cpp b/src/imports/audioengine/qaudioengine_openal_p.cpp index 839a584c5..fd9b1da1f 100644 --- a/src/imports/audioengine/qaudioengine_openal_p.cpp +++ b/src/imports/audioengine/qaudioengine_openal_p.cpp @@ -235,15 +235,15 @@ QAudioEnginePrivate::~QAudioEnginePrivate() #ifdef DEBUG_AUDIOENGINE qDebug() << "QAudioEnginePrivate::dtor"; #endif - QObjectList children = this->children(); - foreach (QObject *child, children) { + const QObjectList children = this->children(); + for (QObject *child : children) { QSoundSourcePrivate* s = qobject_cast<QSoundSourcePrivate*>(child); if (!s) continue; s->release(); } - foreach (QSoundBufferPrivateAL *buffer, m_staticBufferPool) { + for (QSoundBufferPrivateAL *buffer : qAsConst(m_staticBufferPool)) { delete buffer; } m_staticBufferPool.clear(); diff --git a/src/imports/audioengine/qdeclarative_audioengine_p.cpp b/src/imports/audioengine/qdeclarative_audioengine_p.cpp index dd80c698d..78e759be2 100644 --- a/src/imports/audioengine/qdeclarative_audioengine_p.cpp +++ b/src/imports/audioengine/qdeclarative_audioengine_p.cpp @@ -247,7 +247,8 @@ void QDeclarativeAudioEngine::initSound(QDeclarativeSound *sound) } sound->setAttenuationModelObject(attenuationModel); - foreach (QDeclarativePlayVariation *playVariation, sound->playlist()) { + const auto playList = sound->playlist(); + for (QDeclarativePlayVariation *playVariation : playList) { if (m_samples.contains(playVariation->sample())) { playVariation->setSampleObject( qobject_cast<QDeclarativeAudioSample*>( @@ -454,7 +455,8 @@ void QDeclarativeAudioEngine::componentComplete() #ifdef DEBUG_AUDIOENGINE qDebug() << "init samples" << m_samples.keys().count(); #endif - foreach (const QString& key, m_samples.keys()) { + const auto samplesKeys = m_samples.keys(); + for (const QString& key : samplesKeys) { QDeclarativeAudioSample *sample = qobject_cast<QDeclarativeAudioSample*>( qvariant_cast<QObject*>(m_samples[key])); if (!sample) { @@ -468,7 +470,8 @@ void QDeclarativeAudioEngine::componentComplete() #ifdef DEBUG_AUDIOENGINE qDebug() << "init sounds" << m_sounds.keys().count(); #endif - foreach (const QString& key, m_sounds.keys()) { + const auto soundsKeys = m_sounds.keys(); + for (const QString& key : soundsKeys) { QDeclarativeSound *sound = qobject_cast<QDeclarativeSound*>( qvariant_cast<QObject*>(m_sounds[key])); @@ -504,7 +507,7 @@ void QDeclarativeAudioEngine::updateSoundInstances() } QVector3D listenerPosition = this->listener()->position(); - foreach (QSoundInstance *instance, m_activeSoundInstances) { + for (QSoundInstance *instance : qAsConst(m_activeSoundInstances)) { if (instance->state() == QSoundInstance::PlayingState && instance->attenuationEnabled()) { instance->update3DVolume(listenerPosition); diff --git a/src/imports/multimedia/qdeclarativecamera.cpp b/src/imports/multimedia/qdeclarativecamera.cpp index eac1c0c9b..368b1f036 100644 --- a/src/imports/multimedia/qdeclarativecamera.cpp +++ b/src/imports/multimedia/qdeclarativecamera.cpp @@ -982,11 +982,11 @@ QJSValue QDeclarativeCamera::supportedViewfinderResolutions(qreal minimumFrameRa QCameraViewfinderSettings settings; settings.setMinimumFrameRate(minimumFrameRate); settings.setMaximumFrameRate(maximumFrameRate); - QList<QSize> resolutions = m_camera->supportedViewfinderResolutions(settings); + const QList<QSize> resolutions = m_camera->supportedViewfinderResolutions(settings); QJSValue supportedResolutions = engine->newArray(resolutions.count()); int i = 0; - Q_FOREACH (const QSize &resolution, resolutions) { + for (const QSize &resolution : resolutions) { QJSValue size = engine->newObject(); size.setProperty(QStringLiteral("width"), resolution.width()); size.setProperty(QStringLiteral("height"), resolution.height()); @@ -1024,11 +1024,11 @@ QJSValue QDeclarativeCamera::supportedViewfinderFrameRateRanges(const QJSValue & if (width.isNumber() && height.isNumber()) settings.setResolution(width.toInt(), height.toInt()); } - QList<QCamera::FrameRateRange> frameRateRanges = m_camera->supportedViewfinderFrameRateRanges(settings); + const QList<QCamera::FrameRateRange> frameRateRanges = m_camera->supportedViewfinderFrameRateRanges(settings); QJSValue supportedFrameRateRanges = engine->newArray(frameRateRanges.count()); int i = 0; - Q_FOREACH (const QCamera::FrameRateRange &frameRateRange, frameRateRanges) { + for (const QCamera::FrameRateRange &frameRateRange : frameRateRanges) { QJSValue range = engine->newObject(); range.setProperty(QStringLiteral("minimumFrameRate"), frameRateRange.minimumFrameRate); range.setProperty(QStringLiteral("maximumFrameRate"), frameRateRange.maximumFrameRate); |