Assert that QWidgetPrivate::create creates a window

Assert the expected side effect of createTLSysExtra, which might not
allocate a window, but must do so in this case (as we have already
returned if the QWidget is not a window).

Fixes static analyzer warning 2f3bbfe8addb586445e96f8906d6769e

Change-Id: I4d5b8651b3510eff8e4a7b25889c0521ba6a4247
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8cc72e0f634f1406a42c74b864914ccdfb3e58f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2021-02-25 13:12:14 +01:00 committed by Qt Cherry-pick Bot
parent f89039cbad
commit e904f59872

View File

@ -1246,6 +1246,7 @@ void QWidgetPrivate::create()
// in case the extra was already valid.
if (!win) {
createTLSysExtra();
Q_ASSERT(topData()->window);
win = topData()->window;
}