TechDraw: Replace dynamic_cast with qobject_cast
This commit is contained in:
committed by
Benjamin Nauck
parent
6e2583cdcd
commit
216166d853
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user