TechDraw: Replace dynamic_cast with qobject_cast

This commit is contained in:
Kacper Donat
2025-04-07 20:00:03 +02:00
committed by Benjamin Nauck
parent 6e2583cdcd
commit 216166d853
6 changed files with 9 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ TechDrawHandler::~TechDrawHandler()
void TechDrawHandler::activate(QGVPage* vp)
{
auto* mdi = dynamic_cast<MDIViewPage*>(Gui::getMainWindow()->activeWindow());
auto* mdi = qobject_cast<MDIViewPage*>(Gui::getMainWindow()->activeWindow());
if (!mdi) {
return;
}
@@ -79,7 +79,7 @@ void TechDrawHandler::deactivate()
// So to prevent the menu from appearing when the tool is cleared by right mouse click
// we set a small timer.
QTimer::singleShot(100, []() { // 100 milliseconds delay
auto* mdi = dynamic_cast<MDIViewPage*>(Gui::getMainWindow()->activeWindow());
auto* mdi = qobject_cast<MDIViewPage*>(Gui::getMainWindow()->activeWindow());
if (!mdi) {
return;
}