diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-06-12 12:52:31 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-14 14:40:18 +0200 |
commit | 0bc96d1d6ba29c6e0a4c39cc526d9515036b7453 (patch) | |
tree | 84648cf632a289e5348ba68f38adf40a1396ec43 /src/widgets/kernel/qwidget.cpp | |
parent | b6f24423716b82686c86d33828b7139ac717afdd (diff) |
Widgets: Do not create QWindow in createTLExtra().
QWidget::setWindowIcon() and similar call createTLExtra()
which creates a QWindow without setting the native attributes
on the parent, which can cause crashes when setParent_sys()
decides to delete the window.
Task-number: QTBUG-31672
Change-Id: I4c40ee12741be88b2281df90329ffb698d4009eb
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cfccce7c41..f67a93c7b5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1546,10 +1546,11 @@ void QWidgetPrivate::createTLExtra() x->inTopLevelResize = false; x->inRepaint = false; x->embedded = 0; + x->window = 0; + x->screenIndex = 0; #ifdef Q_WS_MAC x->wasMaximized = false; #endif // Q_WS_MAC - createTLSysExtra(); #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -10109,6 +10110,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; } case Qt::WA_NativeWindow: { d->createTLExtra(); + if (on) + d->createTLSysExtra(); #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() |