From 381e4b4d5afb0c2a95861d13dafaf3f92f76ae2e Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 23 Sep 2021 11:17:42 +0200 Subject: [PATCH] Gui: use cbegin()/cend() for const_iterator --- src/Gui/UiLoader.cpp | 4 ++-- src/Gui/WidgetFactory.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Gui/UiLoader.cpp b/src/Gui/UiLoader.cpp index 54a6accfe8..1f35360112 100644 --- a/src/Gui/UiLoader.cpp +++ b/src/Gui/UiLoader.cpp @@ -577,8 +577,8 @@ Py::Object UiLoaderPy::load(const Py::Tuple& args) if (wrap.loadCoreModule()) { std::string fn; QFile file; - QIODevice* device = 0; - QWidget* parent = 0; + QIODevice* device = nullptr; + QWidget* parent = nullptr; if (wrap.toCString(args[0], fn)) { file.setFileName(QString::fromUtf8(fn.c_str())); if (!file.open(QFile::ReadOnly)) diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 2ba90ac294..b68456e7a4 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -499,11 +499,11 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) QObject* objS=nullptr; QList list = myDlg->findChildren(); - QList::const_iterator it = list.begin(); + QList::const_iterator it = list.cbegin(); QObject *obj; QString sigStr = QString::fromLatin1("2%1").arg(QString::fromLatin1(signal)); - while ( it != list.end() ) { + while ( it != list.cend() ) { obj = *it; ++it; if (obj->objectName() == QLatin1String(sender)) { @@ -546,11 +546,11 @@ Py::Object PyResource::value(const Py::Tuple& args) QVariant v; if (myDlg) { QList list = myDlg->findChildren(); - QList::const_iterator it = list.begin(); + QList::const_iterator it = list.cbegin(); QObject *obj; bool fnd = false; - while ( it != list.end() ) { + while ( it != list.cend() ) { obj = *it; ++it; if (obj->objectName() == QLatin1String(psName)) { @@ -646,11 +646,11 @@ Py::Object PyResource::setValue(const Py::Tuple& args) if (myDlg) { QList list = myDlg->findChildren(); - QList::const_iterator it = list.begin(); + QList::const_iterator it = list.cbegin(); QObject *obj; bool fnd = false; - while ( it != list.end() ) { + while ( it != list.cend() ) { obj = *it; ++it; if (obj->objectName() == QLatin1String(psName)) {