Reduce nesting in processWindowScreenChangedEvent()

Replace if-block with early return on null QWindow.

Pick-to: 6.6
Task-number: QTBUG-116232
Change-Id: Iaf402edfd9b03734b64fdf707834fa92c827a1dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Sørvig 2023-08-23 10:09:31 +02:00
parent f5b4a18b56
commit 198eaaf523

View File

@ -2579,7 +2579,10 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse) 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()) if (window->screen() == wse->screen.data())
return; return;
@ -2601,7 +2604,6 @@ void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterf
#endif #endif
QWindowPrivate::get(window)->updateDevicePixelRatio(); QWindowPrivate::get(window)->updateDevicePixelRatio();
} }
}
void QGuiApplicationPrivate::processWindowDevicePixelRatioChangedEvent(QWindowSystemInterfacePrivate::WindowDevicePixelRatioChangedEvent *wde) void QGuiApplicationPrivate::processWindowDevicePixelRatioChangedEvent(QWindowSystemInterfacePrivate::WindowDevicePixelRatioChangedEvent *wde)
{ {