summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-15 10:52:02 +0300
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-01-15 13:59:16 +0000
commit0595b127ce4c6d026b3fa0a6e30c7469a0a625c1 (patch)
treefd36d27093cf65a41cfa0e5c8965ed1bddc95a18 /src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
parent64fbbdd7385b83073e97aca9a020c51be2875060 (diff)
QtMultimediaQuickTools: replace foreach with range-based for
Change-Id: I729375c1de712f1fb7915c95ce9eb7dcd00fe757 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp')
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index 70d48dd9..36572f61 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -64,7 +64,8 @@ QDeclarativeVideoRendererBackend::QDeclarativeVideoRendererBackend(QDeclarativeV
// Prioritize the plugin requested by the environment
QString requestedVideoNode = QString::fromLatin1(qgetenv("QT_VIDEONODE"));
- foreach (const QString &key, videoNodeFactoryLoader()->keys()) {
+ const auto keys = videoNodeFactoryLoader()->keys();
+ for (const QString &key : keys) {
QObject *instance = videoNodeFactoryLoader()->instance(key);
QSGVideoNodeFactoryInterface* plugin = qobject_cast<QSGVideoNodeFactoryInterface*>(instance);
if (plugin) {
@@ -124,7 +125,7 @@ class FilterRunnableDeleter : public QRunnable
public:
FilterRunnableDeleter(const QList<QVideoFilterRunnable *> &runnables) : m_runnables(runnables) { }
void run() Q_DECL_OVERRIDE {
- foreach (QVideoFilterRunnable *runnable, m_runnables)
+ for (QVideoFilterRunnable *runnable : qAsConst(m_runnables))
delete runnable;
}
private:
@@ -335,7 +336,7 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
}
if (!videoNode) {
- foreach (QSGVideoNodeFactoryInterface* factory, m_videoNodeFactories) {
+ for (QSGVideoNodeFactoryInterface* factory : qAsConst(m_videoNodeFactories)) {
// Get a node that supports our frame. The surface is irrelevant, our
// QSGVideoItemSurface supports (logically) anything.
videoNode = factory->createNode(QVideoSurfaceFormat(m_frame.size(), m_frame.pixelFormat(), m_frame.handleType()));
@@ -437,7 +438,7 @@ QList<QVideoFrame::PixelFormat> QSGVideoItemSurface::supportedPixelFormats(
return formats;
}
- foreach (QSGVideoNodeFactoryInterface* factory, m_backend->m_videoNodeFactories)
+ for (QSGVideoNodeFactoryInterface* factory : qAsConst(m_backend->m_videoNodeFactories))
formats.append(factory->supportedPixelFormats(handleType));
return formats;