From: Jørgen Lind Date: Wed, 27 Apr 2011 08:05:52 +0000 (+0200) Subject: Lighthouse: use maybetopdata instead of creating topdata for all X-Git-Tag: qt-v5.0.0-alpha1~3626^2~629 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4eb1543337ff1002d9c2f74a54e761925332e2c7;p=profile%2Fivi%2Fqtbase.git Lighthouse: use maybetopdata instead of creating topdata for all widgets (cherry picked from commit 873764aa3cfbbd87bbbb4f3224a7807d46a16fc7) --- diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp index c9f3dc6..4fd6896 100644 --- a/src/gui/kernel/qplatformscreen_qpa.cpp +++ b/src/gui/kernel/qplatformscreen_qpa.cpp @@ -84,12 +84,15 @@ QSize QPlatformScreen::physicalSize() const Q_GUI_EXPORT extern QWidgetPrivate *qt_widget_private(QWidget *widget); QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget) { + int screenIndex = 0; QWidget *window = widget->window(); QWidgetPrivate *windowPrivate = qt_widget_private(window); - QTLWExtra * topData = windowPrivate->topData(); + QTLWExtra * topData = windowPrivate->maybeTopData(); + if (topData) + screenIndex = topData->screenIndex; QPlatformIntegration *integration = QApplicationPrivate::platformIntegration(); - return integration->screens()[topData->screenIndex]; + return integration->screens()[screenIndex]; } /*!