diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 42bc5b6164..ed3fc5b67b 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -519,10 +519,7 @@ void QQnxWindow::setParent(const QPlatformWindow *window) { qWindowDebug() << Q_FUNC_INFO << "window =" << this->window() << "platformWindow =" << window; // Cast away the const, we need to modify the hierarchy. - QQnxWindow *newParent = 0; - - if (window) - newParent = static_cast((QPlatformWindow *)window); + QQnxWindow* const newParent = static_cast(const_cast(window)); if (newParent == m_parentWindow) return;