diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 339e6d248e..685965442b 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -741,11 +741,8 @@ QWindow *QWidget::windowHandle() const { Q_D(const QWidget); QTLWExtra *extra = d->maybeTopData(); - if (extra) { - if (!extra->window) - const_cast(d)->createTLSysExtra(); + if (extra) return extra->window; - } return 0; }