I have a problem with Qt 4.1.3.

I wrote a custom QWidget (say: widget1) that creates another QWidget (say widget2) in another window, but when widget1 is destroyed widget2 is not destroyed. WIth Qt 4.1.2 widget2 is destroyed.

Here is the code I wrote:

Qt Code:
  1. void CustomWidget1::someMethod()
  2. {
  3. widget2 = new CustomWidget2(this);
  4. widget2->setWindowFlags(Qt::Window);
  5. widget2->setAttribute(Qt::WA_DeleteOnClose);
  6. }
To copy to clipboard, switch view to plain text mode 

I found there are some changes in Qt 4.1.3 regarding QWidget.
from changes-4.1.3:

- QWidget
Made sure that the application does not close if a widget with a
visible parent exists.
Fixed issue where scroll() would scroll child widgets in some cases.
Fixed painting issues when resizing very large child widgets.
Fixed a bug preventing setCursor() from working with platform-
dependent cursors.