Fix crash when deleting top level windows embedded into QGraphicsProxyWidget.

Clear proxyWidget pointer in slot
QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot().

Task-number: QTBUG-29684
Task-number: QTBUG-33213
Change-Id: Ibdbd52aa810ca908e3d98daa00954345e7a93a48
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
This commit is contained in:
Friedemann Kleint 2014-04-14 17:02:42 +02:00 committed by The Qt Project
parent c3bd4d08b0
commit ff2dbe609e
2 changed files with 4 additions and 7 deletions

View File

@ -379,6 +379,10 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next)
void QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot()
{
Q_Q(QGraphicsProxyWidget);
if (!widget.isNull()) {
if (QWExtra *extra = widget->d_func()->extra)
extra->proxyWidget = 0;
}
widget = 0;
delete q;
}

View File

@ -2502,9 +2502,6 @@ void tst_QGraphicsProxyWidget::popup_basic()
void tst_QGraphicsProxyWidget::popup_subwidget()
{
#ifdef Q_OS_WIN
QSKIP("This test crashes on Windows, QTBUG-33213");
#endif
QGroupBox *groupBox = new QGroupBox;
groupBox->setTitle("GroupBox");
groupBox->setCheckable(true);
@ -3183,10 +3180,6 @@ void tst_QGraphicsProxyWidget::actionsContextMenu()
void tst_QGraphicsProxyWidget::deleteProxyForChildWidget()
{
#if defined(Q_OS_WIN)
QSKIP("This test is crashing on windows, it needs to be fixed. QTBUG-29684");
#endif
QDialog dialog;
dialog.resize(320, 120);
dialog.move(80, 40);