aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/QtUiTools/glue/plugins.h')
-rw-r--r--sources/pyside2/PySide2/QtUiTools/glue/plugins.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h b/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
index d1b250d5..9bfcec6e 100644
--- a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
+++ b/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
@@ -43,13 +43,14 @@
#include <QPluginLoader>
#include "customwidgets.h"
-inline void registerCustomWidget(PyObject* obj)
+inline void registerCustomWidget(PyObject *obj)
{
- static PyCustomWidgets* plugin = 0;
+ static PyCustomWidgets *plugin = nullptr;
if (plugin == 0) {
- foreach(QObject* o, QPluginLoader::staticInstances()) {
- plugin = qobject_cast<PyCustomWidgets*>(o);
+ const auto &instances = QPluginLoader::staticInstances();
+ for (QObject *o : instances) {
+ plugin = qobject_cast<PyCustomWidgets *>(o);
if (plugin)
break;
}