Misc: Replace dynamic_cast with qobject_cast
This commit is contained in:
committed by
Benjamin Nauck
parent
6c7c7a747d
commit
e18c88bd23
@@ -1042,7 +1042,7 @@ bool MainWindow::eventFilter(QObject* o, QEvent* e)
|
||||
if (e->type() == QEvent::WindowStateChange) {
|
||||
// notify all mdi views when the active view receives a show normal, show minimized
|
||||
// or show maximized event
|
||||
auto view = qobject_cast<MDIView*>(o);
|
||||
auto view = dynamic_cast<MDIView*>(o);
|
||||
if (view) { // emit this signal
|
||||
Qt::WindowStates oldstate = static_cast<QWindowStateChangeEvent*>(e)->oldState();
|
||||
Qt::WindowStates newstate = view->windowState();
|
||||
@@ -1691,7 +1691,7 @@ void MainWindow::switchToDockedMode()
|
||||
// Search for all top-level MDI views
|
||||
QWidgetList toplevel = QApplication::topLevelWidgets();
|
||||
for (const auto & it : toplevel) {
|
||||
auto view = qobject_cast<MDIView*>(it);
|
||||
auto view = dynamic_cast<MDIView*>(it);
|
||||
if (view)
|
||||
view->setCurrentViewMode(MDIView::Child);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user