Made tst_QWidget::repaintWhenChildDeleted() pass.
authorSamuel Rødal <samuel.rodal@nokia.com>
Mon, 6 Jun 2011 10:37:55 +0000 (12:37 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Mon, 6 Jun 2011 10:38:41 +0000 (12:38 +0200)
Implement some missing functionality in QWidget::destroy().

src/widgets/kernel/qwidget_qpa.cpp

index 169977d..2867fdc 100644 (file)
@@ -150,12 +150,18 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
 {
     Q_D(QWidget);
 
+    d->aboutToDestroy();
+    if (!isWindow() && parentWidget())
+        parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
+
     if ((windowType() == Qt::Popup))
         qApp->d_func()->closePopup(this);
 
     if (this == QApplicationPrivate::active_window)
         QApplication::setActiveWindow(0);
 
+    setAttribute(Qt::WA_WState_Created, false);
+
     if (windowType() != Qt::Desktop) {
         if (destroySubWindows) {
             QObjectList childList(children());
@@ -175,6 +181,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
                 d->hide_sys();
             }
         }
+
+        d->setWinId(0);
     }
 }