Misc: Replace dynamic_cast with qobject_cast

This commit is contained in:
Kacper Donat
2025-04-07 20:00:08 +02:00
committed by Benjamin Nauck
parent 6c7c7a747d
commit e18c88bd23
10 changed files with 20 additions and 20 deletions

View File

@@ -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);
}