Widgets: Fix a startup crash in QSplashScreen (Linguist).

Change-Id: I38f5920fb62277f97e9b3b45651527c2475556ac
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
bb10
Friedemann Kleint 2011-10-19 10:29:01 +02:00 committed by Qt by Nokia
parent 19c322b089
commit 6c4aa14ecc
1 changed files with 3 additions and 2 deletions

View File

@ -1180,8 +1180,9 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
}
#elif defined(Q_WS_QPA)
if (desktopWidget) {
int screen = desktopWidget->d_func()->topData()->screenIndex;
q->windowHandle()->setScreen(QGuiApplication::screens().value(screen, 0));
const int screen = desktopWidget->d_func()->topData()->screenIndex;
if (QWindow *window = q->windowHandle())
window->setScreen(QGuiApplication::screens().value(screen, 0));
}
#else
Q_UNUSED(desktopWidget);