QQnxWindow: use a proper cast

Replace a C-cast with a const_cast.
Casting doesn't care about nullptr, so don't check for one.

Change-Id: I18a3e8f21d73b73385e567c7ceaf64e36aaa2cf3
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Marc Mutz 2012-09-28 14:36:27 +02:00 committed by The Qt Project
parent abcdc7fd87
commit 9801b2c996

View File

@ -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<QQnxWindow*>((QPlatformWindow *)window);
QQnxWindow* const newParent = static_cast<QQnxWindow*>(const_cast<QPlatformWindow*>(window));
if (newParent == m_parentWindow)
return;