diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-15 11:01:43 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-01-15 13:59:08 +0000 |
commit | 64fbbdd7385b83073e97aca9a020c51be2875060 (patch) | |
tree | 15cd842637a392677a736379342922801ef85e20 /src/multimedia/camera | |
parent | 445b55461a644628ab46c871f76a5adb69ab088c (diff) | |
download | qtmultimedia-64fbbdd7385b83073e97aca9a020c51be2875060.tar.gz |
Camera: replace foreach with range-based for
Change-Id: Iedaad3bccea7a5d830f713d87240f5f957ae12c5
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/multimedia/camera')
-rw-r--r-- | src/multimedia/camera/qcamera.cpp | 18 | ||||
-rw-r--r-- | src/multimedia/camera/qcameraexposure.cpp | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index bec894b75..edda3cfbe 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -275,7 +275,7 @@ void QCameraPrivate::updateLockStatus() lockStatuses << q->lockStatus(QCamera::LockWhiteBalance); - foreach (QCamera::LockStatus currentStatus, lockStatuses) { + for (QCamera::LockStatus currentStatus : qAsConst(lockStatuses)) { int currentPriority = lockStatusPriority.value(currentStatus, -1); if (currentPriority > priority) { priority = currentPriority; @@ -655,8 +655,8 @@ QList<QCameraViewfinderSettings> QCamera::supportedViewfinderSettings(const QCam return d->viewfinderSettingsControl2->supportedViewfinderSettings(); QList<QCameraViewfinderSettings> results; - QList<QCameraViewfinderSettings> supported = d->viewfinderSettingsControl2->supportedViewfinderSettings(); - Q_FOREACH (const QCameraViewfinderSettings &s, supported) { + const QList<QCameraViewfinderSettings> supported = d->viewfinderSettingsControl2->supportedViewfinderSettings(); + for (const QCameraViewfinderSettings &s : supported) { if ((settings.resolution().isEmpty() || settings.resolution() == s.resolution()) && (qFuzzyIsNull(settings.minimumFrameRate()) || qFuzzyCompare((float)settings.minimumFrameRate(), (float)s.minimumFrameRate())) && (qFuzzyIsNull(settings.maximumFrameRate()) || qFuzzyCompare((float)settings.maximumFrameRate(), (float)s.maximumFrameRate())) @@ -687,8 +687,8 @@ QList<QCameraViewfinderSettings> QCamera::supportedViewfinderSettings(const QCam QList<QSize> QCamera::supportedViewfinderResolutions(const QCameraViewfinderSettings &settings) const { QList<QSize> resolutions; - QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); - Q_FOREACH (const QCameraViewfinderSettings &s, capabilities) { + const QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); + for (const QCameraViewfinderSettings &s : capabilities) { if (!resolutions.contains(s.resolution())) resolutions.append(s.resolution()); } @@ -716,8 +716,8 @@ QList<QSize> QCamera::supportedViewfinderResolutions(const QCameraViewfinderSett QList<QCamera::FrameRateRange> QCamera::supportedViewfinderFrameRateRanges(const QCameraViewfinderSettings &settings) const { QList<QCamera::FrameRateRange> frameRateRanges; - QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); - Q_FOREACH (const QCameraViewfinderSettings &s, capabilities) { + const QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); + for (const QCameraViewfinderSettings &s : capabilities) { QCamera::FrameRateRange range(s.minimumFrameRate(), s.maximumFrameRate()); if (!frameRateRanges.contains(range)) frameRateRanges.append(range); @@ -745,8 +745,8 @@ QList<QCamera::FrameRateRange> QCamera::supportedViewfinderFrameRateRanges(const QList<QVideoFrame::PixelFormat> QCamera::supportedViewfinderPixelFormats(const QCameraViewfinderSettings &settings) const { QList<QVideoFrame::PixelFormat> pixelFormats; - QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); - Q_FOREACH (const QCameraViewfinderSettings &s, capabilities) { + const QList<QCameraViewfinderSettings> capabilities = supportedViewfinderSettings(settings); + for (const QCameraViewfinderSettings &s : capabilities) { if (!pixelFormats.contains(s.pixelFormat())) pixelFormats.append(s.pixelFormat()); } diff --git a/src/multimedia/camera/qcameraexposure.cpp b/src/multimedia/camera/qcameraexposure.cpp index 5bbce4465..3c5b1cb08 100644 --- a/src/multimedia/camera/qcameraexposure.cpp +++ b/src/multimedia/camera/qcameraexposure.cpp @@ -401,8 +401,8 @@ QList<int> QCameraExposure::supportedIsoSensitivities(bool *continuous) const if (!control) return res; - foreach (const QVariant &value, - control->supportedParameterRange(QCameraExposureControl::ISO, continuous)) { + const auto range = control->supportedParameterRange(QCameraExposureControl::ISO, continuous); + for (const QVariant &value : range) { bool ok = false; int intValue = value.toInt(&ok); if (ok) @@ -497,8 +497,8 @@ QList<qreal> QCameraExposure::supportedApertures(bool * continuous) const if (!control) return res; - foreach (const QVariant &value, - control->supportedParameterRange(QCameraExposureControl::Aperture, continuous)) { + const auto range = control->supportedParameterRange(QCameraExposureControl::Aperture, continuous); + for (const QVariant &value : range) { bool ok = false; qreal realValue = value.toReal(&ok); if (ok) @@ -566,8 +566,8 @@ QList<qreal> QCameraExposure::supportedShutterSpeeds(bool *continuous) const if (!control) return res; - foreach (const QVariant &value, - control->supportedParameterRange(QCameraExposureControl::ShutterSpeed, continuous)) { + const auto range = control->supportedParameterRange(QCameraExposureControl::ShutterSpeed, continuous); + for (const QVariant &value : range) { bool ok = false; qreal realValue = value.toReal(&ok); if (ok) |