Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. * When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
@@ -123,7 +123,7 @@ Py::Object MainWindowPy::getWindows(const Py::Tuple& args)
|
||||
if (_mw) {
|
||||
QList<QWidget*> windows = _mw->windows();
|
||||
for (auto it : windows) {
|
||||
MDIView* view = qobject_cast<MDIView*>(it);
|
||||
auto view = qobject_cast<MDIView*>(it);
|
||||
if (view) {
|
||||
mdis.append(Py::asObject(view->getPyObject()));
|
||||
}
|
||||
@@ -145,7 +145,7 @@ Py::Object MainWindowPy::getWindowsOfType(const Py::Tuple& args)
|
||||
if (_mw) {
|
||||
QList<QWidget*> windows = _mw->windows();
|
||||
for (auto it : windows) {
|
||||
MDIView* view = qobject_cast<MDIView*>(it);
|
||||
auto view = qobject_cast<MDIView*>(it);
|
||||
if (view && view->isDerivedFrom(typeId)) {
|
||||
mdis.append(Py::asObject(view->getPyObject()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user