Misc: Replace dynamic_cast with qobject_cast
This commit is contained in:
committed by
Benjamin Nauck
parent
6c7c7a747d
commit
e18c88bd23
@@ -127,7 +127,7 @@ Py::Object MainWindowPy::getWindows(const Py::Tuple& args)
|
||||
if (_mw) {
|
||||
QList<QWidget*> windows = _mw->windows();
|
||||
for (auto it : windows) {
|
||||
auto view = qobject_cast<MDIView*>(it);
|
||||
auto view = dynamic_cast<MDIView*>(it);
|
||||
if (view) {
|
||||
mdis.append(Py::asObject(view->getPyObject()));
|
||||
}
|
||||
@@ -149,7 +149,7 @@ Py::Object MainWindowPy::getWindowsOfType(const Py::Tuple& args)
|
||||
if (_mw) {
|
||||
QList<QWidget*> windows = _mw->windows();
|
||||
for (auto it : windows) {
|
||||
auto view = qobject_cast<MDIView*>(it);
|
||||
auto view = dynamic_cast<MDIView*>(it);
|
||||
if (view && view->isDerivedFrom(typeId)) {
|
||||
mdis.append(Py::asObject(view->getPyObject()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user