Lighthouse: use maybetopdata instead of creating topdata for all
widgets (cherry picked from commit 873764aa3cfbbd87bbbb4f3224a7807d46a16fc7)
This commit is contained in:
parent
45272d5e45
commit
4eb1543337
@ -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];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user