summaryrefslogtreecommitdiff
path: root/src/activeqt/container/qaxbase.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-02 17:09:54 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-10 12:30:19 +0000
commit5a1ce04cb71263ab078921f5efc8cf30f95a2eb5 (patch)
treec0c4119ab225a0031f4c7a4ac8af8f625c44a0bd /src/activeqt/container/qaxbase.cpp
parent86515f2a650c8e6acc6906d5308061c8cd064408 (diff)
downloadqtactiveqt-5a1ce04cb71263ab078921f5efc8cf30f95a2eb5.tar.gz
Remove foreach
Use range based for. Change-Id: If91077be5bb13aa1447866c4243511db72d4f46c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/activeqt/container/qaxbase.cpp')
-rw-r--r--src/activeqt/container/qaxbase.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index f2deedb..36bf4e6 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -1000,7 +1000,7 @@ bool QAxBase::setControl(const QString &c)
if (search.isEmpty()) {
controls.beginGroup(QLatin1String("/CLSID"));
const QStringList clsids = controls.childGroups();
- foreach (const QString &clsid, clsids) {
+ for (const QString &clsid : clsids) {
const QString name = controls.value(clsid + QLatin1String("/Default")).toString();
if (name == c) {
search = clsid;
@@ -1100,8 +1100,8 @@ void QAxBase::disableClassInfo()
*/
void QAxBase::clear()
{
- foreach (QAxEventSink *eventSink, d->eventSink) {
- if (eventSink) {
+ for (auto it = d->eventSink.cbegin(), end = d->eventSink.cend(); it != end; ++it) {
+ if (QAxEventSink *eventSink = it.value()) {
eventSink->unadvise();
eventSink->Release();
}
@@ -2167,8 +2167,8 @@ void MetaObjectGenerator::readClassInfo()
QString tlfile;
if (!tlid.isEmpty()) {
controls.beginGroup(QLatin1String("/Classes/TypeLib/") + tlid);
- QStringList versions = controls.childGroups();
- foreach (const QString &version, versions) {
+ const QStringList versions = controls.childGroups();
+ for (const QString &version : versions) {
tlfile = controls.value(QLatin1Char('/') + version + QLatin1String("/0/win32/.")).toString();
if (!tlfile.isEmpty())
break;
@@ -2928,7 +2928,7 @@ QMetaObject *MetaObjectGenerator::tryCache()
IConnectionPointContainer *cpoints = 0;
d->ptr->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(&cpoints));
if (cpoints) {
- foreach (const QUuid &iid, d->metaobj->connectionInterfaces) {
+ for (const QUuid &iid : qAsConst(d->metaobj->connectionInterfaces)) {
IConnectionPoint *cpoint = 0;
cpoints->FindConnectionPoint(iid, &cpoint);
if (cpoint) {
@@ -3151,8 +3151,8 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
if (!cacheKey.isEmpty()) {
mo_cache.insert(cacheKey, d->metaobj);
d->cachedMetaObject = true;
- foreach (QAxEventSink *sink, d->eventSink) {
- if (sink) {
+ for (auto it = d->eventSink.cbegin(), end = d->eventSink.cend(); it != end; ++it) {
+ if (QAxEventSink *sink = it.value()) {
QUuid ciid = sink->connectionInterface();
d->metaobj->connectionInterfaces.append(ciid);