Reduce nesting in processWindowScreenChangedEvent()

Replace if-block with early return on null QWindow.

Task-number: QTBUG-116232
Change-Id: Iaf402edfd9b03734b64fdf707834fa92c827a1dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 198eaaf523b8905d23c3b8f01a75647e42012327)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2023-08-23 10:09:31 +02:00 committed by Qt Cherry-pick Bot
parent 8d1cdc1fe8
commit d0378c32d0

View File

@ -2579,7 +2579,10 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)
{
if (QWindow *window = wse->window.data()) {
QWindow *window = wse->window.data();
if (!window)
return;
if (window->screen() == wse->screen.data())
return;
@ -2600,7 +2603,6 @@ void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterf
}
#endif
QWindowPrivate::get(window)->updateDevicePixelRatio();
}
}
void QGuiApplicationPrivate::processWindowDevicePixelRatioChangedEvent(QWindowSystemInterfacePrivate::WindowDevicePixelRatioChangedEvent *wde)