diff options
Diffstat (limited to 'src/activeqt/control/qaxserverbase.cpp')
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 663edf1..f2d4262 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -642,7 +642,7 @@ public: connections = old.connections; that = old.that; iid = old.iid; - foreach (const CONNECTDATA &connection, connections) + for (const CONNECTDATA &connection : qAsConst(connections)) connection.pUnk->AddRef(); } virtual ~QAxConnection() @@ -842,8 +842,8 @@ QClassFactory::QClassFactory(CLSID clsid) InitializeCriticalSection(&refCountSection); // COM only knows the CLSID, but QAxFactory is class name based... - QStringList keys = qAxFactory()->featureList(); - foreach (const QString &key, keys) { + const QStringList keys = qAxFactory()->featureList(); + for (const QString &key : keys) { if (qAxFactory()->classID(key) == clsid) { className = key; break; @@ -906,7 +906,7 @@ HRESULT QClassFactory::CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, voi // Make sure a QApplication instance is present (inprocess case) if (!qApp) { qax_ownQApp = true; - int argc = 0; + static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame new QApplication(argc, 0); } QGuiApplication::setQuitOnLastWindowClosed(false); @@ -1124,9 +1124,8 @@ QAxServerBase::~QAxServerBase() #endif revokeActiveObject(); - - foreach (IConnectionPoint *point, points) { - if (point) + for (auto it = points.cbegin(), end = points.cend(); it != end; ++it) { + if (IConnectionPoint *point = it.value()) point->Release(); } delete aggregatedObject; @@ -1342,7 +1341,7 @@ bool QAxServerBase::internalCreate() if (isWidget) { qt.object->installEventFilter(this); const QWidgetList children = qt.object->findChildren<QWidget*>(); - foreach (QWidget *child, children) + for (QWidget *child : children) child->installEventFilter(this); } return true; |